52

I found a strange option in my simulators list in Xcode I've never seen before. Generic iOS Device in Build Only Device

Interesting, but when I try to build for this device - I get error:

A build only device cannot be used to run this target.
Please select an available device or choose a simulated device as the destination.

Can anyone explain - for what purposes do I need this option?

I have Xcode 7.1 and iOS 9.1

enter image description here

Jeremy Huddleston Sequoia
  • 22,938
  • 5
  • 78
  • 86
ShurupuS
  • 2,923
  • 2
  • 24
  • 44

2 Answers2

58

The purpose of that target is to build for iOS devices, even if your phone is not plugged in. You can compile for iOS (armv7, armv8, arm64) architectures and see if there are any errors upon compilation, as these errors may be different than when you build for iPhone Simulator (i386 architecture).

This allows you to build (+B) for iOS architectures, but you will not be able to run your executable on this target, as there is nothing to run the program on.

Chris Loonam
  • 5,735
  • 6
  • 41
  • 63
10

Also super-useful now: the Generic iOS Device allows you to Archive without having a device plugged in, so you can package the app and upload to iTunes Connect without needing a device!

rswayz
  • 1,122
  • 2
  • 10
  • 21
  • 28
    But earlier if you select iOS Device from run destinations list - u can archive the app without plugging a device as well – ShurupuS Oct 25 '15 at 06:47
  • 3
    @rswayz. I couldn't understand your answer. Actually Archiving doesn't require device to be plugged in , so can u plz explain how does this Generic iOS Device allows you to Archive without having a device plugged in ? – Honey Oct 30 '15 at 07:37
  • 3
    @Honey: ShurupuS is right. In previous version of Xcode (6.x and prior), we also can archive by select "iOS device" without real device plugin. I think that is only new UX design of Xcode, separate 1. "pluged in device"; and 2. "option to build for real device" – huynguyen Nov 01 '15 at 03:17