0

I'm trying to export an ipa file through xcodebuild but I always receive this error.

IDEDistribution: Step failed: : 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 **

Any hint?

This is the shell script I'm using (run in terminal through sh export_script.sh)

xcodebuild clean -project 'MyProject.xcodeproj' -configuration Debug -scheme MyProject -alltargets
xcodebuild -project 'MyProject.xcodeproj' -scheme MyProject archive -archivePath 'MyProject.xcarchive'
xcodebuild -exportArchive -archivePath 'MyProject.xcarchive' -exportPath 'Export' -exportOptionsPlist 'Options.plist'

P.S. Point me out any error in my scripts, if present.

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
  • Possible duplicate of [xcodebuild: "No applicable devices found." when exporting archive](http://stackoverflow.com/questions/33041109/xcodebuild-no-applicable-devices-found-when-exporting-archive) – pablobart Sep 16 '16 at 14:32

4 Answers4

0

I'm not sure, but probably you should specify you need a build for a device.

IgnazioC
  • 4,554
  • 4
  • 33
  • 46
0

You need to add -sdk with proper value (depends on iphoneos with version number)

Serhii Mamontov
  • 4,942
  • 22
  • 26
0

The old way to do it seems to do the job.

xcodebuild -exportArchive -archivePath $XCODE_ARCHIVE -exportPath $EXPORT_PATH -exportFormat ipa -exportProvisioningProfile "$PROVISIONING_PROFILE" -configuration $CONFIGURATION

where $PROVISIONING_PROFILE is for example iOS Development. The archive is created correctly. The shell will print out a deprecation log. You can safely ignore it.

The new way, introduced with Xcode does not work (at least for me). See xcodebuild's new exportOptionsPlist flag.

If you have any hint to use the new way, please post it.

Edit

There is an open radar for it Open Radar. In addition, also Fastlane provides a fallback mechanism for this problem (see Export Failed with Xcode 7 - No applicable devices found).

Lorenzo B
  • 33,216
  • 24
  • 116
  • 190
0

In my case the issue was related to using RVM. Switching to the system Ruby solved the issue:

rvm use system 

Seams like some parts of xcodebuild are relying on the system version of Ruby and don't play nice with RVM.

Miroslav Kovac
  • 1,168
  • 1
  • 16
  • 27