xcode xcodebuild exportArchive:未找到适用的设备

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39634404/
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 09:19:24  来源:igfitidea点击:

xcodebuild exportArchive: no applicable devices found

iosxcodeenterprisexcodebuild

提问by Philipp

After upgrading to Xcode 8 with iOS 10, I get exactly this error. I am on latest El Capitan and using the following versions of ruby (I updated via rvm, same with 2.0.0 which is system version) and CFPropertyList:

使用 iOS 10 升级到 Xcode 8 后,我得到了这个错误。我使用的是最新的 El Capitan 并使用以下版本的 ruby​​(我通过 rvm 更新,与系统版本 2.0.0 相同)和 CFPropertyList:

Philipps-MacBook-Pro:mobile-sdk prakuschan$ ruby -v
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-darwin15]


Philipps-MacBook-Pro:mobile-sdk prakuschan$ gem list CF
*** LOCAL GEMS ***
CFPropertyList (2.3.3)

The xcodebuild -exportArchive command is executed in a shell script, and after a successful archive I get the following error:

xcodebuild -exportArchive 命令在 shell 脚本中执行,成功存档后出现以下错误:

** ARCHIVE SUCCEEDED **
2016-09-22 10:02:16.460 xcodebuild[10375:8369748] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/9y/r64c9wld0jx2yf3glsrzhhr00000gn/T/AppName_2016-09-22_10-02-16.456.xcdistributionlogs'.
2016-09-22 10:02:18.228 xcodebuild[10375:8369748] [MT] IDEDistribution: Step failed: <IDEDistributionThinningStep: 0x7fe435f9dfb0>: Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
error: exportArchive: No applicable devices found.
Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found." UserInfo={NSLocalizedDescription=No applicable devices found.}
** EXPORT FAILED **

When looking into the xcdistributionlogs, the IDEDistribution.standard.log contains the following lines at the very end:

查看 xcdistributionlogs 时,IDEDistribution.standard.log 在最后包含以下几行:

2016-09-22 08:02:18 +0000 [MT] /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool exited with a signal 6
2016-09-22 08:02:18 +0000 [MT] ipatool JSON: (null)

I don't know if it is valuable, but this is the path to ipatool:

我不知道它是否有价值,但这是ipatool的路径:

2016-09-22 08:02:17 +0000 [MT] Running /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool

Any help is highly appreciated. I already tried many suggestions found on google, but found no solution yet.

任何帮助都受到高度赞赏。我已经尝试了在 google 上找到的许多建议,但还没有找到解决方案。

回答by Philipp

I was seeing the same issue. After searching through:

我看到了同样的问题。搜索后:

https://forums.developer.apple.com/thread/13446

https://forums.developer.apple.com/thread/13446

And elsewhere for Xcode 7 similar issues. I realized this one is unique. You can fix it if you tweak the ipatool script in Xcode 8.

和其他地方的 Xcode 7 类似的问题。我意识到这是独一无二的。如果您在 Xcode 8 中调整 ipatool 脚本,则可以修复它。

sudo vi /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool

And comment out this one line:

并注释掉这一行:

# Check the artwork idiom.
#return nil,"the device doesn't support the app's UIDeviceFamily" unless (deviceTraits.supportedIdioms & bundle.supportedIdioms).size > 0

Found via sleuthing the ipatool command in:

通过侦查 ipatool 命令在以下位置找到:

/var/folders/.../IDEDistribution.standard.log

You can search for these via:

您可以通过以下方式搜索这些:

$ sudo find /private/var -name "*.xcdistributionlogs"


Relevant detail / debugging steps: https://github.com/fastlane/fastlane/issues/8737

相关细节/调试步骤:https: //github.com/fastlane/fastlane/issues/8737

回答by zasadnyy

We had the same issue "No applicable devices found"after running

"No applicable devices found"运行后我们遇到了同样的问题

xcodebuild -exportArchive -archivePath ../bin/archive/GetSocialTestApp.xcarchive -exportPath ../bin/ -exportOptionsPlist ../../scripts/exportOptions.plist

Working solution: wrap xcodebuildwith xcbuild-safe.shfrom fastlane repo. Detailed solution described here.

工作液包装:xcodebuildxcbuild-safe.shFASTLANE回购这里描述详细的解决方案。

As appeared, the problem was caused by rvmenvironment variables, xcbuild-safe.shcleans them before executing xcodebuild.

看起来,问题是由rvm环境变量引起的,xcbuild-safe.sh在执行之前清理它们xcodebuild

Not workingsolutions that we tried:

我们尝试过的无效解决方案:

  • modify ipatoolscript as described here
  • downgrade to ruby 2.0.0
  • install ruby gems CFPropertyList, sqlite3that ipatoolwas complaining about
  • ipatool按照此处所述修改脚本
  • 降级到 ruby​​ 2.0.0
  • 安装 ruby​​ gems CFPropertyListsqlite3ipatool是抱怨

回答by Nick

I was getting the Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found."with my enterprise project when including a third party framework. My exportOptionsPlistfile contained the compileBitcode=NOentry but the project itself still had bitcode on.

Error Domain=IDEDistributionErrorDomain Code=14 "No applicable devices found."在包含第三方框架时,我正在使用我的企业项目。我的exportOptionsPlist文件包含该compileBitcode=NO条目,但项目本身仍然有位码。

I also used the log at /var/folders/.../IDEDistribution.standard.logand found a clearer error that lead me to the solution.

我还使用了日志 at/var/folders/.../IDEDistribution.standard.log并发现了一个更清晰的错误,使我找到了解决方案。

More info: https://developer.apple.com/library/content/technotes/tn2432/_index.html

更多信息:https: //developer.apple.com/library/content/technotes/tn2432/_index.html

回答by Kun Wang

Copy following and add it to end of your ~/.bashrc (~/.zshrc if you are using ZSH). and quit the terminal and start it again (must).

复制以下内容并将其添加到 ~/.bashrc 的末尾(如果您使用的是 ZSH,则为 ~/.zshrc)。并退出终端并重新启动(必须)

unset RUBYLIB
unset RUBYOPT
unset BUNDLE_BIN_PATH
unset _ORIGINAL_GEM_PATH
unset BUNDLE_GEMFILE
unset GEM_HOME
unset GEM_PATH

FYI:

供参考:

Since Xcode has a dependency to 2 external gems: sqlite and CFPropertyList More information https://github.com/fastlane/fastlane/issues/6495

由于 Xcode 依赖于 2 个外部 gem:sqlite 和 CFPropertyList 更多信息https://github.com/fastlane/fastlane/issues/6495

We have to unset those variables for rbenv, rvm and when the user uses bundler Even if we do not use rbenv in some environments such as CircleCI, We also need to unset GEM_HOME and GEM_PATH explicitly. More information https://github.com/fastlane/fastlane/issues/627

我们必须为rbenv、rvm以及用户使用bundler时取消设置这些变量即使我们在某些环境(例如CircleCI)中不使用rbenv,我们也需要明确地取消设置GEM_HOME和GEM_PATH。更多信息https://github.com/fastlane/fastlane/issues/627

回答by knight2016

That's it! Set the bitcode = no,the error got fixed.

就是这样!设置bitcode = no,错误得到修复。

回答by Bevis Liu

At first, you need to check that if you have installed sqlite3 and CFPropertyList with gem on your mac. Use these commands to review the result in your terminal:

首先,您需要检查您是否在您的 Mac 上安装了带有 gem 的 sqlite3 和 CFPropertyList。使用这些命令在终端中查看结果:

  • gem list | grep sqlite3
  • gem list | grep CFPropertyList
  • gem list | grep sqlite3
  • gem list | grep CFPropertyList

if you print nothing, then you have to install them with sudo

如果你什么都不打印,那么你必须用 sudo 安装它们

  • sudo gem install sqlite3
  • sudo gem install CFPropertyList
  • sudo gem install sqlite3
  • sudo gem install CFPropertyList

回答by Tim

Had a same issue with XCode 8.2.1

XCode 8.2.1 有同样的问题

In my case the issue was reproducing on exporting an archive for either adhoc or appstore distribution with the following export info plist

在我的情况下,问题是在使用以下导出信息 plist 导出临时或应用商店分发的存档时重现

<?xml version=1.0 encoding=UTF-8?>
<!DOCTYPE plist PUBLIC -//Apple//DTD PLIST 1.0//EN http://www.apple.com/DTDs/PropertyList-1.0.dtd>
<plist version=1.0>
<dict>
        <key>teamID</key>
        <string>TEAMID</string>
        <key>method</key>
        <string>ad-hoc</string> # or `app-store`
        <key>uploadSymbols</key>
        <true/>
        <key>compileBitcode</key>
        <false/>
        <key>uploadBitcode</key>
        <false/>
</dict>
</plist>

It turned out that one of the linked frameworks was compiled using bitcode. This was pointed out from the xcode export log: IDEDistribution.stadard.log:

事实证明,其中一个链接框架是使用 bitcode 编译的。这是从 xcode 导出日志中指出的 IDEDistribution.stadard.log

error: Failed to verify bitcode in YandexMapKit.framework/YandexMapKit:
error: Bundle only contains bitcode-marker /var/folders/zb/ftpjx10s547ddmzm_ybqdm51xdv_t7/T/IDEDistributionThinningStep.NKQ/Payload/Avito.app/Frameworks/YandexMapKit.framework/YandexMapKit (armv7)

I had to manually recompile the YandexMapKitproject into iphoneos- and iphonesimulator- frameworks and merge them into a universal framework

我不得不手动将YandexMapKit项目重新编译成iphoneos- 和iphonesimulator- 框架并将它们合并到一个通用框架中

回答by Nicolas Braun

@Tom Harada answers worked for me but I wanted to find what was causing the default ipatoolto break.

@Tom Harada 的答案对我有用,但我想找出导致默认值ipatool中断的原因。

It was the Google Cast 3.2 SDK, which was missing an entry it the plist framework. Updating it to 3.3 solved the export issue.

它是 Google Cast 3.2 SDK,它缺少 plist 框架的条目。将其更新到 3.3 解决了导出问题。

Refs: https://code.google.com/p/google-cast-sdk/issues/detail?id=954https://github.com/fastlane/fastlane/issues/6223#issuecomment-267343853

参考:https: //code.google.com/p/google-cast-sdk/issues/detail ?id =954 https://github.com/fastlane/fastlane/issues/6223#issuecomment-267343853

回答by riven

My build script have the same problem, and I check some framework that I added. There is a framework that include a plist file(the name is the same as Info.plist). So, I delete the Info.plist file, the build script work fine.

我的构建脚本有同样的问题,我检查了我添加的一些框架。有一个包含 plist 文件的框架(名称与 Info.plist 相同)。所以,我删除了 Info.plist 文件,构建脚本工作正常。

enter image description here

在此处输入图片说明