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.
- Check that the account is well registered on the iTunes Connect portal.
- Check that you are successfully logged out from the App Store application.
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.
- Check that the application is correctly declared the iTunes Connect portal (check the bundle identifier and bunder version).
If you see storeagent: Unsigned App
, then the application is either not properly signed or the storeagent
rejects the signature.
- This is either a problem in the Xcode project or an invalid certificate.
- Always use a Mac App Store certificate to sign the application. @LBE(DO NOT USE)@ a Developer ID certificate.
-
If you are on OS X 10.9.0 and 10.9.1, an issue exists with the
storeagent
daemon. So if you get the message, two solutions currently exist:-
Apple DTS Solution First, run
codesign -vvvv
on the affected app to make sure it doesn’t have a genuine signing problem (and if so, fix it). Then, if codesign verifies the app andstoreagent
says “Unsigned App”, then do this:$ cd /System/Library/Frameworks/Security.framework
$ sudo mv PlugIns Versions/Current/PlugIns
$ sudo ln -s Versions/Current/PlugIns .
-
-
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 thestoreagent
is refusing to consider the application as properly signed. You may also have a line beginning withorigin=
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 thespctl
command to check that the application is now accepted. Launch you application from the Finder. If it does not work, kill thestoreagent
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 an application is installed for the first time, the attribute is empty
- when an application is updated, the attribute contains the bundle version of the initial version.
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:
- You have signed the application with a valid developer certificate generated on the Mac Dev Center. @LBE(DO NOT USE)@ a Developer ID certificate.
- You have defined the application on the iTunes Connect portal.
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:
- If you see
storeagent: Unsigned App
, then the application is not properly signed. - 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.
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:
- A receipt is already present in the bundle, but it does not match (identifier/version/MAC address).
- You have a mismatch between the bundle identifier/version in the
Info.plist
file and the ones in the Receigen code. Be sure that the values match everywhere. - You have multiple copies of the same application with different receipts. Be sure to only have one copy of the application for a given version, otherwise it can lead to weird behaviors.
- If your application is using sandboxing, you can try to remove the application’s container:
it is located under
~/Library/Containers
folder and named from the bundle identifier. - If a receipt has been download, but you still have the message, run you application in
Debug
configuration. The generated code contains debug log statements that help to find out what is going wrong.
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:
- Open the Activity Monitor application and kill the
storeagent
process (the original tip comes from the Apple Developer Forums). - Retry to launch your application. The right receipt should be retrieved.
- Or you can open a Terminal window and launch the command
sudo pkill -f storeagent
On OS X 10.10:
- Open a Terminal window and launch the command
sudo pkill -f CommerceKit
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.