Selecting Provisioning Profile for MacOS app via command line

Since my first deploy I've been uploading my app to Appstore using XCode user interface, and everything works as expected. However, I would like to start uploading the app via command line, and when I upload the app via altool (xcrun altool --upload-app ${appname}.pkg) I get a feedback from Apple saying a provisioning profile was not selected.

Is there a way to explicitly pick a Provisioning Profile via command line? Maybe as an argument or something like that.

Answered by DTS Engineer in 713739022

so I'm using xcodebuild and then i use productbuild to create the .pkg from the .app

I think you’re working too hard here. If you can build your app with xcodebuild then you can use that to create an installer package directly. Use the archive action to create an Xcode archive and then the -exportArchive option to export that a Mac App Store-ready installer package from that archive. See the Export an App from Xcode section of Creating Distribution-Signed Code for Mac and the various docs it links too.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

altool is not involved in provisioning profiles; it just uploads whatever you given it. If there’s a profile missing then that’s related to the way that your app is built.

How are you creating the installer package (.pkg) that you pass to altool? Using Distribute App > App Store Connect > Export in the Xcode organiser? Or using xcodebuild?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

so I'm using xcodebuild and then i use productbuild to create the .pkg from the .app

I think you’re working too hard here. If you can build your app with xcodebuild then you can use that to create an installer package directly. Use the archive action to create an Xcode archive and then the -exportArchive option to export that a Mac App Store-ready installer package from that archive. See the Export an App from Xcode section of Creating Distribution-Signed Code for Mac and the various docs it links too.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Selecting Provisioning Profile for MacOS app via command line
 
 
Q