OS X Diagnostic

iOS Diagnostic

OS X

Diagnostic

Most issues can be diagnosed by looking at the console logs. Launch the Console application (located under /Applications/Utilities), and look into the All Messages logs:

If the application is built in Debug mode you, the validation code prints debug messages.

If you see storeagent: promptResponse: <CKSignInPromptResponse:0x01234567 returnCode:-1>, then test user credentials are wrong.

If you see storeagent: promptResponse: <CKSignInPromptResponse:0x01234567 returnCode:1>, then test user credentials are ok and the problem may be in the declaration of the application on the iTunes Connect portal.

If you see storeagent: Unsigned App, then the application is either not properly signed or the storeagent rejects the signature.

  1. System Policy Control Solution

    Execute codesign -vvvvv <YourApp>.app and check that the application is properly signed.

    Execute codesign --display --requirements - <YourApp>.app and check that the application satisfies its requirements.

    Execute spctl -vvvvv --assess <YourApp>.app and check that the application is authorized.

    If you get a rejected message, this may explain why the storeagent is refusing to consider the application as properly signed. You may also have a line beginning with origin= that tells the rejected origin. This should be the name of your signing certificate.

    To solve the rejection, you have to add a new policy requirement for that origin so the application is considered as properly signed. Execute:

    spctl --add --requirement "anchor apple generic and certificate leaf[subject.CN] = \"3rd Party Mac Developer Application: <YourName>\"" --label "MAS"

    Replace the value for the subject.CN by the rejected origin. Once the policy is added, re-execute the spctl command to check that the application is now accepted. Launch you application from the Finder. If it does not work, kill the storeagent process and retry.

Launch Issues

If you see a dialog "XXX" is damaged and can't be opened., then there is a cache issue with one of the StoreKit daemon.

Open a Terminal and execute the following commands:

killall storeaccountd
killall storeassetd
killall storedownloadd
killall storeinappd
rm -r ~/Library/Caches/storeaccountd
rm -r ~/Library/Caches/storeassetd
rm -r ~/Library/Caches/storedownloadd
rm -r ~/Library/Caches/storeinappd

This will kill all the daemons and reset the caches. A failed validation should properly show the credential dialog.

Common Issues

When I test receipt validation, the Original Bundle Version is always empty. What is wrong ?

The behavior of this attribute is the following:

When testing receipt validation on OS X 10.9+ or iOS 7+, the attribute always contains “1.0”. On other version of OS X, the attribute never seems to contain a value. It may be related to the way test receipts are generated.

When I launch my application, no receipt is retrieved. What is wrong ?

First, check that:

It is REALLY REALLY important to properly define the application in the iTunes Connect portal. Then, you may also open the Console application (located under /Applications/Utilities), and look into the All Messages logs:

When I launch my application, I get a “XXX.app is damaged and can’t be opened”. What is wrong ?

The causes for this problem may be multiple:

In some rare cases, even if everything is ok, the wrong version is retrieved in the receipt. This seems to be linked to a caching issue in the storeagent daemon:

On OS X 10.6 to 10.9:

On OS X 10.10:

I can get a valid receipt, but when I make an InApp purchase, I get a message “Your Apple ID has been disabled [Environment: Sandbox]” ?

Unfortunately, your Apple ID is definitively disabled. There is no way (apart from contacting the support) to re-enable it.

The most probable cause is that you have try to log in the Mac App Store application, and Apple has disable the account. A good rule of thumb is to avoid the use of the Mac App Store application during the tests (i.e. log off and quit).

iOS

Diagnostic

Most issues can be diagnosed by looking at the console logs. In Xcode, open the Organizer window. Plug the device. Once ready, select the device and click on the Console item:

If the application is built in Debug mode you, the validation code prints debug messages.

Common Issues

When the receipt refresh request is triggered, I can only enter my password. How to enter my test credentials ?

In order to use your test credentials, you have to log-off from the iTunes Store and AppStore. Go to Settings > AppStore and click on your identifier, then log-off. The next time a receipt refresh request is triggered, you will be able to enter your test crendentials.