Altool validation fails with cryptic error message

I have an .app which I want to distribute on the AppStore. The AppStore page is set up. I would like to upload a first build. I create a .pkg file with

pkgbuild --install-location ~/Applications --component ./AppName.app ./PkgFileName.pkg

This succeeds, and if I run this file created locally it correctly installs in the applications folder. After this I would like to validate this file with altool:

xcrun altool --validate-app -f ./PkgFileName.pkg -t osx -u <my_apple_id> -p @keychain:"altoolpass"

This fails with the following message:

*** Error: Validation failed for 'PkgFileName.pkg'. *** Error: Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in ‘PkgFileName.pkg’. Unable to validate your application. (-21017)

{ NSLocalizedDescription = "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in \U2018<app_name>\U2019."; NSLocalizedFailureReason = "Unable to validate your application."; }

I'm stumped by this, because the original .app file contains an Info.plist in .app/Contents/Info.plist, and this file has the CFBundleIdentifier key, and the value is the same as we set up on the AppStore page. Why is it still giving me this error?

Are you building your app with Xcode? Or with a third-party build system? If you’re building with Xcode, I recommend that you start by validating from the Xcode organiser, just to do a basic smoke test.

I create a .pkg file with …

That’s not the approach I recommend. Rather, create your installer package with productbuild. See Packaging Mac Software for Distribution for the specific command.

Share and Enjoy

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

Altool validation fails with cryptic error message
 
 
Q