xcodebuild exportArchive: no applicable devices found

Philipp picture Philipp · Sep 22, 2016 · Viewed 9.1k times · Source

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:

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:

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

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:

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.

Answer

user560766 picture user560766 · Oct 2, 2016

I was seeing the same issue. After searching through:

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.

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:

/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