xcodebuild how to sign app with command line?

久未见 提交于 2019-12-01 06:02:25
alaslipknot

It turns out that I was using the wrong commands; specifically this part is wrong:

-PROVISIONING_PROFILE= xxxxxxx-8a61-4264-8fe9-0513bd7935e6 
-CODE_SIGN_IDENTITY=iPhone Developer:xxxxx

The correct one is this:

-exportProvisioningProfile "Provisioning profile full name "

Provisioning profile full name is the same name that appear in Xcode, not the UDID (I don't know why many people suggested that) also there is no need to specify the signing identity.

Anyway, here is the full command line that is working for me now:

xcodebuild -exportArchive -archivePath myArchive.xcarchive -exportPath myApp.ipa -exportFormat ipa -exportProvisioningProfile "Provisioning profile full name"

NOTE:

  • I am running this command after copying the archive in a folder (desktop) then changing the terminal location to that folder (cd desktop) and then running the command
  • Also don't forget to change the provisioning profile based on your archive build configuration (release or debug), you can change that from the scheme setting to either make a debug or a release build.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!