Search code examples
iosxcode6xcodebuildxcode6.1

xcodebuild command fails building for device since upgrade to Xcode 6.1


I cannot build my project for the device although XCode can build without any issue given the same settings.

Here is the build command:

/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace /path/to/workspace/myProject.xcworkspace -scheme myScheme -configuration Debug -destination id=myDeviceIdentifier build

Here is the error i get:

xcodebuild: error: The run destination [device name] is not valid for Running the scheme 'myScheme'.
[device name] doesn't match any of myProject.app's targeted device families. You can expand myProject.app's targeted device families to support [device name].

I did check the targeted device family for the project and all of the subprojects, and it is fine.

The problem appears less often after removing a significant count of file references from the project.

Did some of you encounter the same issue and do you know how to fix it?


Solution

  • i could bypass the issue by debugging as universal app, although i am developing for ipad.

    this changes TARGETED_DEVICE_FAMILY from 2 (iPad) to "1,2" (Universal) in the project file (project.pbxproj).


    there's also a quite simple way to reproduce the issue:

    if you create two projects from template. one will work one not.

    WORKS: Single View App, Objective C, Universal DOES NOT WORK: Single View App, Objective C, iPad

    more information can be found here:

    please file this issue with apple: http://bugreport.apple.com