I've got an app for which I want to validate the Mac App Store receipt.
As I understand it, in case there is no receipt, the application should exit with exit code 173. That is what I implemented. Normally what should happen next is, that I am prompted for a sandbox username and password. These credentials are then used to get a new receipt from the App Store.
The problem is that I am not prompted for a username. The only thing that happens is that I get the following error:
“<AppName>” is damaged and can’t be opened. Delete “<AppName>” and download it again from the App Store.
The internet (and this forum too) has quite some instances of this problem. In some cases it is the macOS version that is to blame, in my case it probably is not, since I'm running on 12.2.1.
So after digging through the console, I found this line, that puzzles me:
default 21:05:16.537045+0100 appstoreagent AMSURLRequestEncoder: [C579757A] Encoding request for URL: https://sandbox.itunes.apple.com/commerce/device/addPushNotificationType {
account = <ACAccount: 0x7ff1c492c070 type = iTunesStore.sandbox | backingID = 22BFC0A5-D3E2-4412-8915-E7E5FFA8CE87 | username = jimi@smashbits.nl | altDSID = 001234-10-ff0bd4b9-72fc-4f56-8a98-032977bf5a37 | DSID = 840396218 | active = (null) | storefront = appstore.sandbox:143452-10,13>
mediaType = com.apple.AppleMediaServices.accountmediatype.appstore
}
What is of interest here is that a sandbox user is used, see the username = jimi@smashbits.nl
part. The problem is that this user does not exist anymore.
Does anyone know how to reset the appstoreagent or any of the services involved in retrieving a receipt, so that I am prompted again for a username? I can then use a valid sandbox user and hopefully have a receipt generated to get to some actual programming.