The problem: If you make a program for the Mac App Store, and you want to test it, e.g. make sure the MASreceipt and/or codesign checking works correctly, you cannot do that with your "Developer ID" certificate, because that's the wrong one for the App Store and there's also no injected receipt file.
The normal solution is to use Apple's TestFlight, which emulates most of the App Store behavior
However, there are still two problems with using TestFlight:
- The injected receipt is slightly different.
- The TestFlight app is needed to install the app, but TestFlight only runs on macOS 12 and later.
So, how do you test a program for the MAS before you deliver it to the public?
The solution is to submit the app for release on the Mac App Store, but check the option to release the app manually (that option is found on the bottom of the submission page).
That way, once the app has been approved, it won't get released yet.
Now you can create a Promo Code for the app (found on the "Services" page in App Store Connect) and use that code to install the app via the Mac App Store app.
This works on pre-Monterey systems, too.