xcodebuild:“找不到适用的设备."导出存档时 [英] xcodebuild: "No applicable devices found." when exporting archive
问题描述
从 Xcode 7† 开始,xcodebuild
导出存档步骤一直给我们错误.
As of Xcode 7†, the xcodebuild
export archive step has been giving us errors.
构建命令
xcodebuild -exportArchive -archivePath "path/to/Thing.xcarchive" \
-exportPath "path/to/" \
-exportOptionsPlist path/to/PackageOptions-adhoc.plist
收益
2015-10-08 16:28:27.409 xcodebuild[62682:464728] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7ff1a42d23f0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo=0x7ff1a72ddd80 {NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo=0x7ff1a72ddd80 {NSLocalizedDescription=No applicable devices found.}
** EXPORT FAILED **
什么给?如何修复?
† 7.0 &7.0.1,在小牛队.
† 7.0 & 7.0.1, on Mavericks.
推荐答案
在我们的例子中,这与我们通过 rvm 使用非系统 ruby 存在冲突.要修复,您需要在 rvm use system
的上下文中调用 xcodebuild
.但是这样做很复杂,因为在脚本中使用 rvm
比它应该更难.
In our case, this was a conflict with our use of a non-system ruby via rvm. To fix, you need to call xcodebuild
inside the context of rvm use system
. But doing this is complicated by the fact that using rvm
in scripts is harder than it should be.
我们创建了一个脚本来解决这个问题:
We created a script which fixed this for us:
#!/bin/bash --login
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
rvm use system
xcodebuild "$@"
这是 xcodebuild 的替代品,其中
This is a drop-in replacement for xcodebuild, where
xcodebuild arg1 ... argn
会变成
path/to/xcbuild-safe.sh arg1 ... argn
我已经gisted 一个生产就绪版本.确保在该文件上chmod +x
.
I've gisted a production-ready version. Make sure you chmod +x
on that file.
这篇关于xcodebuild:“找不到适用的设备."导出存档时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!