Page 1 of 3

Mac App Store Approval

Posted: Sat Aug 13, 2011 5:24 am
by J. Baker
This is how to get your sandboxed app approved on the Mac App Store, as of Aug 13 2012. Your app is already considered compiled. Text that are BOLD are for you to edit for your own app.

*A sandboxed app needs to read and write all of its preference data and so forth from...
"Library/Containers/com.yourcompany.YourApp/Data/Library/Application Support/Your App/"


If your app is sandboxed, GetHomeDirectory() doesn't return your usual directory. It returns "/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/", the sandboxed containers folder for the app.

But when your sandboxed app first launches, it automatically creates...
"/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/Library/Application Support/"

So you just need to create AppName (Sprite Monkey in my case) directory to store your preference files and so forth.
"/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/Library/Application Support/Sprite Monkey/"


1.) You have to purchase a Developers lincense which is $99 plus tax USD. Make sure to select Mac Developer and NOT iOS Developer. You'll need a bank account in order for Apple to pay you for your sales. So get your bank information ready when you're ready to purchase your license.

2.) You'll eventually get an email with an activation code to complete your license purchase. You'll need to click the link to activate the account.

3.) Sign in to your new account at https://developer.apple.com/.

4.) Click on "Mac Dev Center".

5.) Click on the "Learn More" under "Get Your Mac Apps Ready for the Mac App Store".

6.) Scroll down and click on "Register your App ID". This is the page where you will create your "App ID" and "Certificates". You create two certificates. One for the app and one for the installer.

7.) Download your certificates and double click on them to import them into "Keychain Access". You can close "Keychain Access" now but remember their names.

8.) Right click on your app and choose "Show Package Contents". Open "Contents" folder. Open your info.plist in "TextEdit". Make sure it matches the following and "LSApplicationCategoryType" stays at the top or your app could get rejected. Edit where needed.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Your App Name</string>
<key>CFBundleGetInfoString</key>
<string>Your App Name 1.0, Copyright © 2012 Company Name Inc. All rights reserved.</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.company name.app name</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Your App Name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>PURE</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
</dict>
</plist>
9.) Save it and close "TextEdit".

10.) Now you need to create an entitlements (Your App.entitlements) file. This can be done in TextEdit. Just make sure to change the extension to ".entitlements". This file has to be signed with your app and allows your app to function when sandboxed. But you need to have the correct entitlements in it. You can find more on entitlements here...
http://developer.apple.com/library/ios/ ... ments.html

The following sandboxes the app, allows open and save requesters and allows an app to read/write anywhere in or below a users home folder...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
<string>/</string>
</array>
</dict>
</plist>
*Just a note. The last temporary entitlement allows my app to export files not noted in the SaveFileRequester(). If your app only exports a single file that is named in the SaveFileRequester(), you should be fine without it. Also, if you add an extension (*.png or whatever) in the SaveFileRequester(), make sure to do it there. Else if your app checks for it later and adds it, the sandboxed app will not export the file. As it only sees the original Result$ from the SaveFileRequester().

11.) Icon Composer no longer seems to be in Xcode. So I use the following app to create my 1024x1024 icon (*.icns). New size is required for the new retina displays.
http://itunes.apple.com/us/app/icon-sla ... 7913?mt=12
You'll have to click on the "2X" button to make the 1024x1024 size. Make sure to create all the smaller sizes too, in the "1:1" area of the app.

12.) Runs these lines in the "Terminal" one at a time. Edit what's in bold to your own info.
sudo chmod -R a+xr "/Users/Your Name/Desktop/Your App.app"
codesign -f -s "3rd Party Mac Developer Application: Your Name" --entitlements "/Users/Your Name/Desktop/Your App.entitlements" "/Users/Your Name/Desktop/Your App.app"
productbuild --component "/Users/Your Name/Desktop/Your App.app" /Applications --sign "3rd Party Mac Developer Installer: Your Name" yourapp.pkg
*Just a note. If you want to build a 64-bit app for outside of the Mac App Store and keep compatibility with Snow Leopard and up, read the following post...
http://www.purebasic.fr/english/viewtop ... 02#p468002

13.) Now you will need to test the installer you just made. Put your app temporarily in the trash or the installer will think it is already installed. Edit where needed.
sudo installer -store -pkg /Users/Your Name/installername.pkg -target /
14.) Go to https://itunesconnect.apple.com/ if you haven't already and set that up. Once that is all set up you will be ready to upload.

15.) Open "Application Loader v2.7" or better. You can find it in Xcode. Or just "Show Package Contents" by right clicking on the Xcode app and view "Contents" then "Applications". This will allow you to select your installer package and upload it to iTunes Connect.
Xcode is in your "Applications" folder as of v4.4 for Lion and Mountain Lion.

If all went well, your app on iTunes Connect should be "Waiting for Review". I believe this is everything. Good luck! ;)

Re: Mac App Store Approval

Posted: Sat Aug 13, 2011 11:40 am
by luis
I don't have a Mac but it's very nice of you to have made this.

Thank you :)

Re: Mac App Store Approval

Posted: Sat Aug 13, 2011 6:40 pm
by spacebuddy
Nice info thank you :)

Has anyones app been accepted in the store yet?

Re: Mac App Store Approval

Posted: Sat Aug 13, 2011 6:52 pm
by J. Baker
luis wrote:I don't have a Mac but it's very nice of you to have made this.

Thank you :)
Your welcome!
spacebuddy wrote:Nice info thank you :)

Has anyones app been accepted in the store yet?
Your welcome!

My app was accepted on Aug. 11. :D

Re: Mac App Store Approval

Posted: Sat Aug 13, 2011 11:37 pm
by Polo
Seems as annoying as getting an iOS app accepted :)
Thanks for the detailed process though, might be handy!

Re: Mac App Store Approval

Posted: Sun Aug 14, 2011 1:50 am
by J. Baker
Polo wrote:Seems as annoying as getting an iOS app accepted :)
Thanks for the detailed process though, might be handy!
LOL! Your welcome!

Re: Mac App Store Approval

Posted: Sun Aug 14, 2011 4:15 am
by kenmo
Thanks for this guide!

Re: Mac App Store Approval

Posted: Sun Aug 14, 2011 4:22 am
by J. Baker
kenmo wrote:Thanks for this guide!

I may try this out in the future, but first I need to finish some software that could make $100+ in order to justify the $99 fee!

Do you know what % of your sales revenue Apple takes?
No problem!

My app sales for $1.99 USD and I get $1.40 USD off each sale. ;)

Re: Mac App Store Approval

Posted: Sun Aug 14, 2011 4:48 am
by moogle
kenmo wrote:Do you know what % of your sales revenue Apple takes?
It's always been 30% iirc.

Re: Mac App Store Approval

Posted: Sun Aug 14, 2011 11:22 am
by Polo
moogle wrote:
kenmo wrote:Do you know what % of your sales revenue Apple takes?
It's always been 30% iirc.
Yeah, they take 30% plus 79 euros per year.

Re: Mac App Store Approval

Posted: Thu Oct 20, 2011 7:07 pm
by jesperbrannmark
Hehe... everyone being so productive... including me :wink:
I posted my first OS X app for approval just 30 seconds ago. Could not have done it without this fantastic guide. Hopefully I will post another one tomorrow.

Re: Mac App Store Approval

Posted: Thu Oct 20, 2011 7:34 pm
by Ramihyn_
jesperbrannmark wrote:Hehe... everyone being so productive... including me :wink:
I posted my first OS X app for approval just 30 seconds ago. Could not have done it without this fantastic guide. Hopefully I will post another one tomorrow.
Grats :)

Re: Mac App Store Approval

Posted: Sun Oct 23, 2011 8:50 am
by jamirokwai
Hiya,

just want to share a little Terminal-Script, giving you step 11 and 12 in one rush.
Replace the 3rd-Party Developer Name <name> with the information of your license, and the rights of the .sh with "sudo chmod -R a+xr app.sh".

The you may call the helper in Terminal.app with (EDIT: don't forget to name your App correctly here with path and all. Just drag the .App-Bundle onto Terminal.)

Code: Select all

./app.sh "<Path to You App/YourApp.app>"
Here is the script... It will change the rights, sign the app, build the pkg, and install you app into /Applications.

Code: Select all

sudo chmod -R a+xr "$1"
codesign -f -s "3rd Party Mac Developer Application: <name>" "$1"
productbuild --component "$1" /Applications --sign "3rd Party Mac Developer Installer: <name>" "$1.pkg"
sudo installer -store -pkg "$1.pkg" -target /
Does it work for you?
It does here on Mac OS X Lion 10.7.2

Re: Mac App Store Approval

Posted: Wed Oct 26, 2011 5:02 pm
by jesperbrannmark
Just got rejected because I named the app "My App Name"... A hint. what is bold and mentioned as change this above - change it... (i am so stupid)

Re: Mac App Store Approval

Posted: Thu Oct 27, 2011 9:54 am
by jamirokwai
jesperbrannmark wrote:Just got rejected because I named the app "My App Name"... A hint. what is bold and mentioned as change this above - change it... (i am so stupid)
That's hard. You wait 10 days for the approval, and it stops working because of something obvious, you didn't think of.
Believe me, it happened to me the first time, too... :-)