简体   繁体   English

由于升级到Xcode 6.1,xcodebuild命令无法为设备构建

[英]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. 尽管可以在没有相同设置的情况下构建XCode但我无法为该设备构建项目。

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? 你们中的某些人是否遇到过同样的问题,您知道如何解决吗?

i could bypass the issue by debugging as universal app, although i am developing for ipad. 尽管我正在为iPad开发,但我可以通过调试为通用应用程序来绕过此问题。

this changes TARGETED_DEVICE_FAMILY from 2 (iPad) to "1,2" (Universal) in the project file ( project.pbxproj ) . 这会将TARGETED_DEVICE_FAMILY2 (iPad)更改为项目文件project.pbxproj中的"1,2" (通用


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 作品:Single View App,Objective C,通用不起作用:Single View App,Objective C,iPad

more information can be found here: 更多信息可以在这里找到:

please file this issue with apple: http://bugreport.apple.com 请向苹果提交此问题: http : //bugreport.apple.com

Try this steps: 请尝试以下步骤:

  • Go to Targets -> Valid Architectures & remove arm64 转到目标->有效架构并删除arm64
  • Set Build active Architectures to No 将构建活动架构设置为否

there might be another workaround by enabling a lot of debug output. 通过启用大量调试输出,可能还有另一种解决方法。

add the following parameter to the command: 在命令中添加以下参数:

xcodebuild … -IDERunDestinationLogLevel=3 xcodebuild … -IDERunDestinationLogLevel=3

somehow if log level 3 is set, building works. 如果设置了日志级别3,则建筑物可以正常工作。 with log level 2 it does not. 日志级别为2则不会。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM