简体   繁体   中英

How to specify app id when upload to iTunesConnect using command line

Summary

I`m trying to automatize my applications upload to iTunesConnect.

I have at least 6 apps and all are always "ready to upload".

The problem is when I try to upload an app to iTunesConnect using command line, I have the following error message:

"warning: There are more that one application pre-configured in iTunesConnect. Only the first will be used.".

Questions

  • How can I know what is the first?
  • Is there a way to set the first?
  • Is there a way to specify which app I am trying to submit? How I am doing it?

Build Script...

xcodebuild -target $TARGETNAME -configuration Release -sdk iphoneos clean build "CODE_SIGN_IDENTITY=iPhone Distribution: XXXXX..." "PROVISIONING_PROFILE=XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"

xcrun -sdk iphoneos PackageApplication -v $CURRENTDIR/build/Release-iphoneos/$TARGETNAME.app -o $CURRENTDIR/Dist/$TARGETNAME.ipa --sign "iPhone Distribution: XXXXX..." --embed "path/to/XXXXX.mobileprovision"

Upload Script...

security add-generic-password -s Xcode:itunesconnect.apple.com -a user@email.com -w password -U

xcrun -sdk iphoneos Validation -verbose -online -upload ./Dist/$TARGETNAME.ipa

security delete-generic-password  -s Xcode:itunesconnect.apple.com -a user@email.com

After the recent changes of iTunes Connect, you might want to check out my new open source library: https://github.com/KrauseFx/deliver

It will use the iTMSTransporter to upload your app to iTunes Connect.

You can take a look at how the app is uploaded here: https://github.com/KrauseFx/deliver/blob/master/lib/deliver/itunes_transporter.rb

I released a gist to get the identifier of the next app to be published on iTunesConnect: https://gist.github.com/KrauseFx/db0ea9c884465e507602

I couldn't find a way to specify the app you want to upload. At least now there is a way to receive the identifier of the next app to be uploaded.

Basically I use the 'xcrun -sdk iphoneos Validation' command and read its output to determine the identifier.

http://diegopeinador.blogspot.com/2013/10/automatic-app-creation-and-binary-upload.html this article contains the solution, but you have to use iTMSTransporter (Application Loader's command line tool) instead of xcrun Validation .

Basically you need only the last line from the script in the article. I've simplified it by removing params that I don't need, so it looks

/path/to/iTMSTransporter -u "${ITUNESCONNECT_LOGIN}" -p "${ITUNESCONNECT_PASSWORD}" -m upload -v critical -f /path/to/.itmp/or/folder/containing/.itmp

I had solved this another way with xrun before seeing the Transporter solution. Instead of specifying a bundle id to xrun, I try to find out which is the next in queue and just submit that.

So, my script simply does a "test" Validation of a random one of my apps and I capture the output of xcrun. The error message mentions the desired bundle id, so I build and submit that app instead.

If the next in the queue is an update instead of a new app, Validate will not tell you the bundle id, so you have to do a "test" -upload and the output will have :

ReservedBundleIdentifier = "..."

which again tells you which one to build next. To avoid this being slow, have a very small app for the "test" upload.

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