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?

Upvotes: 0

Views: 1332

Answers (3)

dreamlab
dreamlab

Reputation: 3361

there might be another workaround by enabling a lot of debug output.

add the following parameter to the command:

xcodebuild …-IDERunDestinationLogLevel=3

somehow if log level 3 is set, building works. with log level 2 it does not.

Upvotes: 0

dreamlab
dreamlab

Reputation: 3361

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

Upvotes: 1

cyberlobe
cyberlobe

Reputation: 1783

Try this steps:

  • Go to Targets -> Valid Architectures & remove arm64
  • Set Build active Architectures to No

Upvotes: 0

Related Questions