Xcode checks before uploading to notarisation server - can altool do that?

Hello,


When I use Xcode to upload an app to the notarisation service, it seems that Xcode performs some basic sanity checks before performing the upload. Is there a way of replicating this behaviour on the command line with xcodebuild/altool?


For example: say I have an app in which I have neglected to enable the hardened runtime.


Using Xcode, I create the archive and then through Organiser, move through the Distrubute App -> Develop ID -> Upload stages. When I then click on Next, a spinner briefly appears during which it says "Analysing Signature".


It is at this point that it will present an error message about the hardened runtime not being enabled.


This is really helpful, as it lets me know there's a problem before uploading to the notarisation server.


My question is this: is it possible to replicate this behaviour with the command line tools xcodebuild and altool?


Given the same scenario as above, if I try to notarise my "broken" app using the command line tools, the steps are as follows:

  • xcodebuild archive
  • xcodebuild -exportArchive
  • ditto (to creat the zip)
  • xcrun altool --notarize-app


And it's not until I query the notarisation process using the UUID received in the last step above that I find out about the hardened runtime being disabled.


Is there anything I can do on the command line to check the archive for potential problems before uploading to the notarisation server and thus mimic Xcode's behaviour?


Thanks in advance.


Heather.

Accepted Answer

is it possible to replicate this behaviour with the command line tools

xcodebuild
and
altool
?

That depends on what you’re looking for specifically:

  • If you’d like to run exactly the same checks that Xcode runs, that’s currently not possible. An enhancement request for that would be welcome (please post your bug number, just for the record).

  • If you want to create a submission script that explicitly checks for various criteria, like the hardened runtime, you can certainly do that, using either the

    codesign
    tool or the code signing API.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Feedback assistant number `FB6857406`.

Xcode checks before uploading to notarisation server - can altool do that?
 
 
Q