Search code examples
xcodexcodebuild

xcodebuild error: no provisioning profile matches


I'm trying to build and archive my XCode project using following command:

xcodebuild -scheme MyApp -workspace MyApp.xcworkspace clean archive -archivePath build/MyApp
xcodebuild -configuration AdHoc -exportArchive -exportFormat ipa -archivePath "build/MyApp.xcarchive" -exportPath "build/MyApp.ipa" -exportProvisioningProfile "afe33cd1-5e6c-47a6-a315-bd442e43ad95"

It is building successfully but exporting ipa is failling with following error:

error: no provisioning profile matches 'afe33cd1-5e6c-47a6-a315-bd442e43ad95'
** EXPORT FAILED **

I have tried following as well

 -exportProvisioningProfile "afe33cd1-5e6c-47a6-a315-bd442e43ad95.mobileprovision"

I'll appreciate any help in this regard. Thanks


Solution

  • Value of -exportProvisioningProfile should be the exact name of the provision profile in your system, you can copy this exact name from your developer portal also.