Monday, April 4, 2016

Working Around Broken Mac App Store Test Account Switching

Since Mac OS X 10.11.2, I have had problems testing the Mac App Store versions of my apps using an iTunes Connect sandbox user account. You are supposed to be able to launch the app, get prompted for an Apple ID and password, enter the test account credentials, and have it automatically download a receipt and launch the app. Instead, I would get the dreaded “This Apple ID has not yet been used with the App Store. Please review your account information.” alert.

For a brief time in January, test accounts worked for me after I installed an updated Apple certificate in the System keychain. Then, in early March, they stopped working again, despite having the new certificate.

Weeks of communication with Apple via Radar and developer support channels did not produce anything helpful except for the knowledge that completely cleaning out my keychains and certificates did not help. The same problem was occurring on both of my Macs—though, curiously, not in a clean VMware Mac OS X installation that was missing the WWDR certificate that I’d had to update before.

This led me to hypothesize that I was looking in the wrong place with the certificates and actually the problem was with the local store software. I found that deleting the cache folder:

~/Library/Caches/com.apple.appstore

and restarting the Mac allowed me to launch apps using the test user. (I’ve since discovered that others have also found this to help.)

However, this is more of a workaround than a fix because test accounts still don’t work normally, i.e. the way they did prior to December 2015. Once I’ve launched an app with a test account, the App Store app itself becomes unusable. It refuses to let me purchase or update apps, saying that one cannot purchase from the sandbox environment, even though the App Store app is logged into my regular Apple ID.

I got the App Store app to work by again deleting the cache folder and restarting the Mac. However, after I successfully updated a few apps, I again got the Apple ID errors when trying to test apps using a sandbox user. The same thing happened on my other Mac.

My conclusion is that, at least with Mac OS X 10.11.4, every time I want to switch from testing an app to using the Mac App Store like a regular user—or vice-versa—I have to delete the cache folder and restart the Mac.

5 Comments RSS · Twitter

Always test in a dedicated testing account on your Mac. Don't mix your personal stuff with developer stuff. Otherwise, well, you'll be deleting cache folders and restarting all the time.

Another workaround that is a pain, but less so than rebooting, is:

1. Log out of the App Store via the App Store App
2. Quit the App Store App.
3. In a terminal, do:

killall storeassetd

Then launch your app and, when prompted to enter your credentials to get the test receipt it should work - it does for me, at any rate. Do the process again to get back to your regular account.

@AndyM That works! Kind of odd since I never had to change the App Store app’s login before.

[…] However, much remains to be done. The store apps themselves need work, as do the underlying OS services. The Mac App Store still lags behind, without support for gifting apps or TestFlight, and the […]

neither of these worked for me.

My fix was to change the bundle identifier in my app. That triggers a new sign in with the new bogus identifier.
Sign in with the new sandbox id

Then change the bundle identifier back, re-launch my app and I get a sign in prompt again.

Leave a Comment