Before you submit your macOS app to the App Store, test the installation process to verify that your app installs correctly. Do this by exporting your macOS app and selecting the App Store distribution method. Then run this test using the installer
command before you upload your app to App Store Connect. The installer
command verifies that your app will be installed correctly when it’s purchased from the App Store.
In Terminal, execute the following command:
sudo installer -store -pkg path-to-package -target /
The output of the installer
command should be similar to:
rpatel$ sudo installer -store -pkg ../Documents/TrackMix.pkg -target /
WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.
To proceed, enter your password, or type Ctrl-C to abort.
Password:
installer: Note: running installer as an admin user (instead of root) gives better Mac App Store fidelity
installer: TrackMix.pkg has valid signature for submission: 3rd Party Mac Developer Installer: Ravi Patel (7U3X8B3P5Z)
installer: Installation Check: Passed
installer: Volume Check: Passed
installer: Bundle com.example.rpatel.TrackMix will be installed to /Applications/TrackMix.app
installer: Starting install
installer: Install 0.0% complete
installer: Install 90.8% complete
installer: Install 100.0% complete
installer: Finished install
rpatel$
If the installer finds a bundle with the same bundle ID as the one it’s installing, it upgrades the existing app. Users can then install upgrades even if they have moved your app. If you have a copy of your app installed (for example, in your build products directory), you may want to remove it so that the installer installs your app in /Applications
. Other options include archiving the existing version in a ZIP file or moving it to another volume and unmounting that volume.