A build only device cannot be used to run this target.

Hi I just started recently. I am trying to run my first application whic is a single view Application iOs.


Once the project is created I set the build only to a generic OS device and here is the error I get


A build only device cannot be used to run this target.

No supported iOS devices are available. Connect a device to run your application or choose a simulated device as the destination.

Please help me out.


Thanks,

Do you have a valid paid Developer Program account or are you attempting to use 'free provisioning (which also allows you to test your app on a device)?


What is the goal with that build...archive, ad-hoc, simulator, device, store distribution....?

The error message is telling you all you need to know. Select the generic device only if you wish to Product/Analyze or Product/Archice. To run the app you must use the simulator or a real device. The use the simulator select one of the simulators rather than teh generic device. To run on a real device, attach the real device to the Mac and select it. (I believe you must have a developer account to run on a real device.)

I encoured the same error , there's no other device to chose

Do you have a valid paid Developer Program account, or are you attempting to use 'free provisioning (which also allows you to test your app on a device)?

Have you downloaded any simulators? Look under Preferences > Components.


If you have simulators, do they support the OS version you're building?


Is it a beta? At least once I've got a beta that was so early it didn't have any simulators available. If it's beta, upgrade to the release version; the latest one has shipped.

Please connect IPAD

I had the same problem, this happened when I upgrade to XCode 10.0 and started to have some issues. Here is what I did which helped me:


1) Main.Storyboard --> I set iPhone XR

2) Main App --> Deployment Info -->

Deployment Target --> 12.0

Device --> Universal

Main Interface --> Main

3) Compile and succeed

4) Before I run, I just notice there a new button next to play sayine MyApp > iPhone whatever, make sure to changet to iPhone XR matching with your storyboard.

5) Click run and it all worked just fine.


Hope it helps !!

These were all useless answers... especially the one from PBK saying that the message tells you all you need to know. It VERY obviously doesn't if this question has been viewed 26,000 times! The solution is quite simple actually. Go into your iPhone (or other device) settings. Scroll down to Privacy and Security and enable Developer Mode. Reboot, follow the prompts to enable it (you may have to reboot your iPhone and your Mac once more if the versions are out of sync) and Bob's your uncle.

This what I did: up there where you see the history you have to choice which device you will be use, that was helping me

Thank you ! Saved me hours of frustration.

A build only device cannot be used to run this target.
 
 
Q