As of Xcode 7†, the xcodebuild
export archive step has been giving us errors.
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.
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 ofrvm use system
. But doing this is complicated by the fact that usingrvm
in scripts is harder than it should be.We created a script which fixed this for us:
This is a drop-in replacement for xcodebuild, where
would become
I've gisted a production-ready version. Make sure you
chmod +x
on that file.Make sure xcodebuild using the system ruby.
I fixed it by doing this:
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.
You can simply update this gem to fix the problem.
xcodebuild
uses the system ruby, so simply do this: