Home > Net >  Why is xcode running my SwiftUI app as a macOS app when it was created as an iOS app?
Why is xcode running my SwiftUI app as a macOS app when it was created as an iOS app?

Time:02-16

I have created a SwiftUI app for iOS. Under deployment info, I have only Iphone and Ipad checked off.

I have plugged in my iOS physical device.

When I click the run (triangle play button) it launches a macOs desktop app instead of on my iOS device.

How do I change the configuration to run on my iOS device?

CodePudding user response:

I'm guessing that this is occurring because you have one of the newer Macs with an Apple Silicon processor. These computers allow you to run your iOS apps as Mac apps (you can even download some iOS/iPadOS apps on the Mac App Store.

To make it run on a Simulator or on your physical iOS device, select the device from the devices/simulators dropdown at the top of Xcode. If your iOS device is connected to your Mac, you can select it in this dropdown, or you can select a device.

location of devices/simulators dropdown in Xcode

  • Related