Cannot upload ipa file through shell script

Running the following command:

xcrun altool --upload-app --type tvos --file "{IPA_PATH}" --username "{APPLE_ID}" --password "{PASSWORD}"

Results in this error message:

*** Error: Exception caught. Exception caught: *** -[__NSDictionaryM setObject:forKey:]: object cannot be nil (key: cfBundleVersion) (-1010)

I am running the latest XCode 13. altool's version is 4.059.1219. Same build can be uploaded as normal through XCode's UI. Same command was working as expected on the latest Xcode 12.

I have the same problem.

you need to add the missing type to the command -t ios. --> xcrun altool --upload-app -t ios

same problem.

xcodebuild clean archive -archivePath "../dist/$OUTARCHIVE" -scheme $TARGET -quiet -workspace ____ -destination generic/platform=iOS

xcodebuild -exportArchive -archivePath "../dist/$OUTARCHIVE" -exportPath "../dist/$OUTIPA" -exportOptionsPlist ./export.plist

xcrun altool --type ios --upload-app --file "../dist/$OUTIPA" --username ____ --password ______

Tried to add

manageAppVersionAndBuildNumber

to export.plist. No luck.

CFBundleVersion is present in original info.plist as well.

Generated IPA payload contains binary info.plist. CFBundleVersion is also present

Export / Upload to appstore works correctly within XCode itself.

Accepted Answer

Running validate-app gave me a proper error and I was able to resolve my issue.

xcrun altool --validate-app --type ios --file {IPA_PATH} --username "{APPLE_ID}" --password "{PASSWORD}"
** Error: Validation failed for '{IPA_PATH}'.
*** Error: No suitable application records were found. Verify your bundle identifier ‘{BUNDLE_ID}’ is correct. App Store operation failed. (-19000)

The issue in my case was that the uploader account didn't have access to our new Apple Developer Account. Hope this helps you too!

PS: In my original question I posted the wrong type it should have been ios and not tvos. The output is the same though.

you will need access to cloud-managed distribution certs as well, in user and permissions

I have the same issue and I found that the file path can be only supporting the relative path. Absolute path could make it file not found. i.e. xcrun altool --type ios --upload-app --file ./dist/$OUTIPA --username ____ --password ______

Cannot upload ipa file through shell script
 
 
Q