xcode xcodebuild:“找不到适用的设备。” 导出存档时

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33041109/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 08:01:26  来源:igfitidea点击:

xcodebuild: "No applicable devices found." when exporting archive

xcodervmxcode7xcodebuild

提问by Clay Bridges

As of Xcode 7?, the xcodebuildexport archive step has been giving us errors.

从 Xcode 7? 开始,xcodebuild导出存档步骤一直给我们错误。

Build command

构建命令

xcodebuild -exportArchive -archivePath "path/to/Thing.xcarchive" \
        -exportPath "path/to/" \
        -exportOptionsPlist path/to/PackageOptions-adhoc.plist

yields

产量

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 **

What gives? How to fix?

是什么赋予了?怎么修?



? 7.0 & 7.0.1, on Mavericks.

? 7.0 和 7.0.1,在小牛队。

回答by Clay Bridges

In our case, this was a conflict with our use of a non-system ruby via rvm. To fix, you need to call xcodebuildinside the context of rvm use system. But doing this is complicated by the fact that using rvmin scripts is harder than it should be.

在我们的例子中,这与我们通过 rvm 使用非系统 ruby​​ 存在冲突。要修复,您需要xcodebuildrvm use system. 但是这样做很复杂,因为rvm在脚本中使用比它应该的更难。

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 "$@"

This is a drop-in replacement for xcodebuild, where

这是 xcodebuild 的替代品,其中

xcodebuild arg1 ... argn

would become

会成为

path/to/xcbuild-safe.sh arg1 ... argn

I've gisteda production-ready version. Make sure you chmod +xon that file.

我已经提供了一个生产就绪版本。确保你chmod +x在那个文件上。

回答by Sandy Chapman

So the underlying issues as as alluded by Clay Bridges answer is that there is an error happening in Ruby. To be specific, this error is being caused by using an out of date version of the CFPropertyList gem.

因此,正如 Clay Bridges 的回答所暗示的那样,潜在的问题是 Ruby 中发生了错误。具体来说,此错误是由使用过时版本的 CFPropertyList gem 引起的。

You can simply update this gem to fix the problem. xcodebuilduses the system ruby, so simply do this:

你可以简单地更新这个 gem 来解决这个问题。xcodebuild使用系统 ruby​​,所以只需执行以下操作:

/usr/bin/gem install CFPropertyList

回答by dworrad

Make sure xcodebuild using the system ruby.

确保 xcodebuild 使用系统 ruby​​。

I fixed it by doing this:

我通过这样做修复了它:

rvm use system