Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I distribute a beta Mac App Store app using Xcode 6.1?

I'm working on a Mac app that uses StoreKit for in app purchases. On launch it checks for the existence of the appStoreReceiptURL, and exits with code 173 if it doesn't exist, as documented in this tech note from Apple:

https://developer.apple.com/library/ios/technotes/tn2259/_index.html

I've exported the app using the "Export as a Mac Application" as I've done many times in the past for distributing to our beta testers. Normally exiting with code 173 caused OS X to show a "Sign in to download from the App Store" dialog; this was working as recently as late last week. However with the app I exported today using Xcode 6.1 it's not doing this. In the past I had been exporting with Xcode 5.1.

Is anyone else seeing this behaviour? Is there anything that I should be doing differently to ensure that testers will see the app store login prompt?

EDIT: In the build settings for the target I'm building, I've selected Mac Developer code signing identity, and Automatic provisioning profile. The log of the archive process shows that it used the expected Mac Developer signing identity. Then in the Organizer window, I choose "Export as a Mac Application" to export it to disk, and then launch the app by double clicking it's icon in a Finder window. This is the log I see in the console after I double-click (the first line is a log message that the app outputs just before it exits with code 173):

2014-11-21 3:58:43.146 PM MyApp[4144]: to get sandbox receipt, the app must be launched from outside xcode
2014-11-21 3:58:43.148 PM com.apple.xpc.launchd[1]: (com.mycompany.MyApp.337424[4144]) Service exited with abnormal code: 173
2014-11-21 3:58:43.151 PM storeassetd[398]: AssetServiceDelegate: Accepting new connection <NSXPCConnection: 0x7f8d61f2f990> connection from pid 378 with interface <AssetServiceInterface: 0x7f8d606f6cf0> (PID 378)
2014-11-21 3:58:43.151 PM storeassetd[398]: addOperation <FetchReceiptOperation: 0x7f8d61f560a0>{name = '(null)'}

I should add that I'm testing the exported Mac application on Yosemite.

EDIT: I also used Receigen to generate the receipt checking code, and see the same results when I use the code it generates.

like image 847
Greg Avatar asked Nov 21 '14 21:11

Greg


People also ask

Can you submit app with Xcode beta?

In order to distribute your app to beta testers or to users through the App Store, you'll need a separate distribution provisioning profile and distribution certificate. The easiest way to do this is through Xcode.

Is Xcode beta the same as Xcode?

Xcode. Beta versions of Xcode include the latest toolset and SDKs for creating apps that run on upcoming releases of an operating system. Xcode betas are available to all developers on the download page.

How do I distribute my Apple app?

In the Archives organizer, select the archive, then click Distribute App. In the next sheet, select a distribution method based on your app's platform. To distribute to a limited number of users on registered devices only—for example, distribute within your organization—choose Ad Hoc or Development.


2 Answers

Even if everything seems ok, sometimes the storeagent daemon goes wrong. This may lead to:

  • the wrong version is retrieved in the receipt
  • the AppStore login does not show up
  • etc.

A good way to start over is to kill the storeagent:

  • 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

like image 85
Laurent Etiemble Avatar answered Oct 21 '22 13:10

Laurent Etiemble


When exporting the app from the Organizer, choose Export as a Mac Application instead of Export a Developer ID-signed Application - that fixed it for me.

like image 32
EpaL Avatar answered Oct 21 '22 12:10

EpaL