Need help testing app for MAS

I have been reading about the iTunes test account but not sure how it works as my application has no in-app purchases and the info I find is related to iOS and my application is only for Mac OS X.

I want to test the application verifying the receipt but before submitting it for review, is this possible?


Yes. Once my testing in Xojo is complete I run the app through AppWrapper for my web site. Once that works OK I AppWrap it for the MAS. When I run the MAS version it asks for an iTunes account username and password. You can set up an iTunes dummy testing account for this purpose.

I have been doing this over the past few days and any ‘purchases’ of products and subscriptions are considered sandboxed and aren’t actually charged anywhere. It worked well, but I had to verify I was covering all the bases correctly.

It was working for product sales, cancelling a sale and cancelling a confirmation. It worked for subscribing and changing the subscription period, but I have not yet tested what happens once the subscription time runs out.

In each case I am writing the sale to a MySQL database on my server, so I have a record of what they purchased and how much longer they have on their subscription.

I have today submitted by app with products and subscriptions for sale, into the MAS, so we’ll see how it goes.

The macOS is a subclass of iOS, a lot of Apple’s doc now only refer to iOS.

Once you’ve created a test account, you launch the application on your Mac (after it has been signed with the App Store submission certificate) and use the test account name & password to log-in to the iTunes dialog that appears.

If you don’t get an iTunes log-in dialog when you launch your application, then your receipt verification doesn’t work.

If you accidentally use your test account in iTunes or a with an application downloaded from the App Store; Apple will disable that account and you have to create another one.

That’s a good idea, be interesting to know if Apple approves of it however.

Thanks David and Sam for your answer.

I’m a bit confused now: should I just launch in my computer the application after having it wrapped with App Wrapper or do I need to first upload it to the App Store and then download?

I have tried to use the wrapped version and no iTunes dialog appears, only receipt verification fails (as it should). I’m using the 3d party Mac developer application certificate with App Wrapper.

Not sure how the app can get a receipt for testing.

I’m using MBS plugin for the verification, code for verifiying looks like:

[code] Dim f as FolderItem = app.ExecutableFile.Parent.Parent
if f <> nil and f.Exists then
f = f.Child("_MASReceipt").Child(“receipt”)
if f <> nil and f.Exists then
receipt = AppReceiptMBS.ReceiptForFile(f)
if Receipt <> nil then
Dim vbundleIdentifier as String = Receipt.bundleIdentifier
Dim appVersion as String = Receipt.appVersion
if vbundleIdentifier = “com.mycompany.myapp” then
Return True
end if
end if
Return False
end if
end if

Return False[/code]


I couldn’t get the MBS MAS verifier version working so I use the Templeman code:

#if TargetMacOS and not DebugBuild then 'Check App Store Receipt if SystemInformationMBS.MacMajorVersion >= 10 and SystemInformationMBS.MacMinorVersion >= 7 then const hardCodedBundleIdentifier = "com.myCompanyName.myAppName" Dim receipt as appStoreReceipt = appStoreReceipt.mainBundleReciept // --- Load the bundle receipt, if it exists. if appStoreReceipt.appCodeSignature = "" then receipt.reject // --- Make sure app is code signed (does not ensure an App Store cert, as there are 4 possibilities that we're aware of). if not receipt.fileExists then receipt.reject // --- If the receipt file does not exist, then reject. if receipt.bundleIdentifier <> hardCodedBundleIdentifier then receipt.reject // --- Verify the bundle identifier of the receipt matches the hard coded version and the Info.plist if appstoreReceipt.mainBundleIdentifier <> hardCodedBundleIdentifier then receipt.reject if not receipt.hashValid then receipt.reject // --- Verify the Receipt Hash, this one typically fails when the app is copied from one machine t'other. end if #endif

But I do use MBS for the InApp purchases and subscriptions.

[quote=342422:@Alejandro Fresno Meyer]I’m a bit confused now: should I just launch in my computer the application after having it wrapped with App Wrapper or do I need to first upload it to the App Store and then download?

Yes, run the just-AppWrapped application. No, you don’t need to upload to the MAS then download it.

Oh, now I understand. Templeman code includes a way to ask for iTunes login, will have to check it.

Just a question: I haven’t found class appStoreReceipt in MacOsLib 108, is it your own or do I have to look elsewhere?


In the 32-bit days I used MacOS Lib, but I have had to ditch it when going 64-bit. None of it is my own code — I know my limitations and instead prefer to stand on the shoulders of giants!

Now I’m lost, sorry. Isn’t MacOsLib the code you are using?

I haven’t found any other for Templeman. Would appreciate if you can drive me in the correct direction.


My ambiguous mistake — I am using the new MacOSLib code at, but there used to be an older set of 32-bit only libraries that I used in the past.

Thanks David,

I just found thread with the info and code I need (thanks also Sam :wink: )

Are you sure about where you got that code?

No, I can’t remember, but I am pretty sure it was from Sam Rowlands and Thomas Templeman. I assume I had downloaded it from GitHub based on the forum post. Is it available elsewhere? I know it works!

I’m testing the application to work in different OS versions and one is 10.7.5, a MacBook with only 2GB RAM.

Regarding that I’m having also an issue with my pkg installer I’m just copying the wrapped application into the Applications folder.

After executing I get the iTunes dialog box and I enter my Sandbox testing details, at my main computer running OS X 10.12.6 it works fine and a receipt is included in the app file.

But in the MacBook running 10.7.5 it fails, the receipt is not written into the app bundle. The system.log I get is:

Aug 2 12:06:22 ordenador-de-alejandro[1043]: Can’t get dir or base (likely out of memory) for
Aug 2 12:06:22: — last message repeated 1 time —
Aug 2 12:06:22 ordenador-de-alejandro[1043]: Can’t get sandbox fs extension for , status=-1 errno=No such file or directory ext=(null)
Aug 2 12:06:22: — last message repeated 1 time —
Then the log shows the bundle info and that no receipt is available

I believe the problem is that the application is not being able to write the receipt, may be due to low RAM.
Once I remove the receipt verification process from the app code the application opens fine and works as expected.

I tried also with a minimal test application (no plugins, nothing except the MAS_Receipt class), only process is receipt verification at Open event and result is the same.

Does it has minimum requirements for receipt verification?

First I’ve ever heard of this, several years ago Apple altered how their code signing system works, this may have broken it for 10.7. They also made changes in code signing for 10.12, which may also contribute to a failure on 10.7. I would probably recommend that you’re min version be 10.9 or even 10.10.

Apple have never really taken backwards compatibility seriously, which was one of their strengths. However their annual “lets break the OS” updates are really making it hard for developers, and even frustrating for consumers.

Thanks Sam.

To be sure, will setting minimum version to 10.10 also solve the pkg issue I’m having ? Please notice that using Iceberg or Packages I can install the application.

Ah then this is a change to Apple’s ‘App Store’ compatible installer; for a while now I’ve been mulling investigating an alternative installer and it seems that Apple once again may have forced my hand.