0

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?

3 Answers3

1

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

dreamlab
  • 3,321
  • 20
  • 23
0

Try this steps:

  • Go to Targets -> Valid Architectures & remove arm64
  • Set Build active Architectures to No
cyberlobe
  • 1,783
  • 1
  • 18
  • 30
0

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.

dreamlab
  • 3,321
  • 20
  • 23