简体   繁体   中英

EXPORT FAILED error using xcodebuild command line tool

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'

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

我不确定,但您可能应该指定需要为设备构建的版本。

您需要添加-sdk适当的值(取决于使用的iPhoneOS版本号)

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 ).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM