Deploy to MacOS AppStore, Xcode 11.1

  • Re: deploy to OSX AppStore

    Mac deployment seems to be changing on regular intervals.
    In my quick failed attempt I noticed that

    • macdeployqt fails if the TARGET name in qmake .pro file has a space. Naturally the error message is something about objdump not found.
    • Application Loader is gone, something called "xcrun altool" may be a replacement?

    Getting it right the first time seems to be a major pain. Anyone succeeded yet?

  • My Solution

    I took the time to make it work using XCode, below is my own README for the benefit of some other poor soul struggling with the same issues. My project name is Unmot, substitute your own where that appears below.

    First make sure the file works fine in Qt Creator, and that you can build and run it there. To build with xcode for uploading to AppStore, first generate the XCode project with qmake.

    ~/Qt5.13.1/5.13.1/clang_64/bin/qmake -spec macx-xcode

    Then load the generated Unmot.xcodeproj to XCode (11.1 at time of writing).

    We need to add custom step to embed and sign Qt frameworks, because XCode embed&sign will fail for Qt frameworks:

    In XCode open Project Build Phases tab, select your target: Unmot. Go to XCode->Editor menu->Add Build Phase->"Add Run Script Build Phase."
    After Shell /bin/sh add call to macdeployqt, which embeds the Qt frameworks cleaning them in the process so that signing works:

    ~/Qt5.13.1/5.13.1/clang_64/bin/macdeployqt $CODESIGNING_FOLDER_PATH

    Tick "Run script only when installing"

    As last config step, let XCode worry about signing. In XCode, add
    --deep to Other Code Sign Flags in Target Settings (All)

    The build from XCode menu: Product->Archive
    If everything goes well, the generated archive pops up an Organizer window and you can Validate it and Upload to AppStore from there.

  • The instruction in the post above works, except if our application is not qml.

    ~/Qt/5.15.2/clang_64/bin/macdeployqt $BUILT_PRODUCTS_DIR/ -always-overwrite -appstore-compliant

    Does not work

    ~/Qt/5.15.2/clang_64/bin/macdeployqt $BUILT_PRODUCTS_DIR/ -qmldir=~/APPNAME/qml/ -always-overwrite -appstore-compliant

    When submitting to the app store, an error appears:
    The executable could not be re-signed for submission to the App Store. The app may have been built or signed with non-compliant or pre-release tools. With error code STATE_ERROR.VALIDATION_ERROR.90135

Log in to reply