mac apps 上传 mac app store(英文)

本文介绍了如何将Mac应用上传到App Store,包括在应用中设置SpecialFolder路径,如ApplicationData、UserLibrary等。同时,强调了CFBundleIdentifier、CFBundleVersion和NSHumanReadableCopyright的重要性。此外,详细列举了LSApplicationCategoryType的各种分类,帮助开发者选择适合自己应用的类别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

THIS IS A LIVING POST
Expect it to change as I continue working to improve it.

Preface

Apple's Mac App Store is a new and exciting way for independent REAL developers to gain a level of exposure most of us could only dream of before. With almost no effort or expense, we are now able to show off our products to potentially millions of Mac users, as eager to consume our wares as iPhone/iPad/iPod users have proven to be over the past few years.

Image

The process to successfully get an app on to the Mac App Store may seem incredibly intimidating, especially for those of you who strictly develop in REAL and thus lack experience with more traditional methods of Apple development. This post is intended to bring together all the major steps and definitions into an easy document I'm sure many of us (myself included) will refer to again and again. Although at first it may appear overly complex, rest assured all these steps are designed to guarantee the safety of both developers and consumers.

After going through this a few times, I can tell you from personal experience it isn't that bad. I am now to the point where I can process my apps in about five minutes. My best advice is to  help yourself , by creating a logical, well-organized workflow that you can easily repeat again and again.

Please ask questions, make comments, suggestions or corrections by replying to this topic.

Part I: Building and Submitting to the Mac App Store

Step 1
Enroll in the Mac Developer Program . This $99 annual subscription gives you access to beta versions of Mac OS X and Xcode, access to thousands of reference articles, a complete Mac OS development library, and a private and discreet developers forum forum that is often trafficked by Apple developers.

Step 2
Download the latest version of Xcode from the  Mac Developer portal . As of this writing, the current version of Xcode is 3.2.5 and requires the  additional  download and installation of Application Tools 1.1. I'm not sure if this will remain the case with future versions of Xcode (probably not).

Image

Step 3
Before doing anything else, decide what you want your Application Bundle Identifier (Bundle ID) to be (if you haven't already). For most apps, Bundle IDs will be in the format com. yourcompany . yourproduct , i.e. com.apple.itunes for iTunes. You will use this often.

Apple Documentation wrote:
CFBundleIdentifier (String - iOS, Mac OS X) identifies the type of the bundle. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters. The string should also be in reverse-DNS format. For example, if your company’s domain is Ajax.com and you create an application named Hello, you could assign the string com.Ajax.Hello as your application’s bundle identifier. This key does not uniquely identify a specific bundle in the file system, as multiple copies of an application with the same or different version may exist.

Note: Although formatted similarly to a UTI, the character set for a bundle identifier is more restrictive.
The preferences system uses this string to identify the application for which a given preference applies. Launch Services uses the bundle identifier to locate an application capable of opening a particular file, using the first application it finds with the given identifier. In iOS, the bundle identifier is also used in validating the application signature.

Step 4
Ensure your app conforms to the  Mac App Store Review Guidelines  and, more generally, the  Apple Human Interface Guidelines . The latter document is extremely long and time consuming. In a nutshell it says make sure your app doesn't suck.

One of, if not THE most common setback developers seem to encounter is writing to forbidden locations. Below are the REAL Studio-formatted locations you're allowed to write to. Except as noted below, unless a user explicitly chooses to save data in an alternate location (using a Save As file dialog), your application may only write to the following locations:

  • SpecialFolder.ApplicationData.Child("{app-identifier}")
  • SpecialFolder.UserLibrary.Child("{app-identifier}")
  • SpecialFolder.UserLibrary..Child("Caches").Child("{app-identifier}")
  • SpecialFolder.Temporary.Child("{app-identifier}")

Replace {app-identifier} with your application's Bundle ID, its name, or your company's name. These strings  must  match what you provided through iTunes Connect for this application.

If your application manages libraries of photos, music, or movies, the application may also write to the following directories:

  • SpecialFolder.Pictures.Child("{app-identifier}")
  • SpecialFolder.Music.Child("{app-identifier}")
  • SpecialFolder.UserLibrary.Child("Movies").Child("{app-identifier}")

You cannot write to any shared locations. Period. This includes your root-level /Applications folder, or anything inside the root-level /Library folder including /Library/Application Support and /Library/Preferences. I interpret this to also mean you cannot write to the contents of your own application bundle. I haven't tried myself, but even if you could, you shouldn't. So for the sake of this tutorial we'll say you can't.

Step 5
Paid apps should validate their receipts.  Download MacOSLib  and open its project file, select the CertTools module, copy it, go back to your project, and paste it in.

Image

In your App's Open event, the very first thing to do is validate your receipt. Paste in the following code at the very top of the App.Open event. Change the {bracketed} values as appropriate.

// Comment the below certification stuff out if building for your own (non-App Store) distribution.
#if DebugBuild = false then
#if TargetMacOS = true then
dim f as FolderItem
f = app.ExecutableFile.Parent.Parent // "Contents" folder
f = f.Child("_MASReceipt").Child("receipt") // this is where the App Store puts the receipt when "buying" an app
if not CertTools.IsValid (CertTools.DeviceGUID, CertTools.ReadReceipt(f), "{your.bundle.id}") then
declare sub exit_ lib "System" alias "exit" (code as Integer)
exit_ (173)
end
#endif
#endif

Note that  your.bundle.id  is typed right in the call to CertTools.IsValid(). Do not make it a constant or property stored elsewhere.

In CertTools.DeviceGUID(), you  must  choose between using CoreFoundation and IOKit classes, MBS plugins, or a simple shell script. I went with the latter.  Delete all the code that is irrelevant to your choice.  For my case (the shell option),  the entire code  of the DeviceGUID() function ends up like this:

dim sh as new Shell
sh.Execute "/sbin/ifconfig en0"
dim s as String
s = sh.Result
dim lines() as String
lines = ReplaceLineEndings(s,chr(13)).Split(chr(13))
for each line as String in lines
dim p as Integer
line = line.Trim
p = line.InStr("ether ")
if p = 1 then
dim mac as String = line.NthField(" ",2)
dim bytes() as String = mac.Split(":")
if bytes.Ubound = 5 then
return HexBytesToData (bytes)
end if
end if
next

I'm not exactly sure what the benefit of using MBS or any other plugin to do any of this would be. I suspect the answer to be absolutely nothing. In any case, you must make a choice and delete the unnecessary code. It will not compile until you do.

Step 6
Build your application as Intel-only. Carbon is perfectly fine, but it cannot have any PowerPC code whatsoever.

Image

Step 7
Make sure you have a proper 512x512 icon.  Do not rely on any icon REAL Studio generates for your Mac apps.  Create your icon in Photoshop or some other image editor as a 512x512 PNG with alpha transparency. Use Icon Composer (part of Xcode) to convert it to the proper .icns format by simply dragging the PNG version of your icon over the different placeholders. Drag the resulting .icns file into your Application bundle. Make sure it has the  same exact name and location as the useless .icns file generated by REAL Studio that will already be there.

Image

Step 8
Inside your Application bundle, edit the Info.plist file and ensure the following values are included. Please note that Xcode's PLIST editor changes some of these technical names to a human-readable alternatives.

  • CFBundleIdenifier - your Bundle ID from Step 3.
  • CFBundleVersion - must be three-place version number, like 1.3.2. It cannot include letters, and cannot be longer than three places which REAL Studio for some reason makes it, like 1.3.2.0.3. You'll have to correct this after every build.
  • NSHumanReadableCopyright - a human-readable copyright string, like © 2010 REAL Software Inc.
  • LSApplicationCategoryType - the primary App Store category your app will appear under. See list of values for this field in Appendix A.

Image

Step 9
Create a Mac App ID in the  Developer Certificate Utility . This must be the same as your Bundle ID from Step 3.

Image

Step 10
Create a Mac App certificate and Mac Installer certificate using the  Developer Certificate Utility . Download and install both by double-clicking them. These are tied to your developer program, not to your apps, so you only need to do this the first time you build an app. They're good for one year.

Image

Step 11
In the Terminal, navigate to your built Application's folder and run the following commands one at a time, replacing the {bracketed} values with your own values. {Mac App Certificate Name} and {Mac Installer Certificate Name} can be found by going to Applications -> Utilities -> Keychain Access, and clicking on My Certificates. The names will start with  3rd Party Mac Developer Application  and  3rd Party Mac Developer Installer , respectively:

Image
Image

You need to use this entire name for the bracketed values below.

codesign -s '{Mac App Certificate Name}' {AppBundleName}.app

codesign -d -vvvv {AppBundleName}.app

productbuild --component '{AppBundleName}.app' /Applications --sign '{Mac Installer Certificate Name}' {AppBundleName}.pkg

To illustrate with an example, here is how the commands would hypothetically be formatted for iTunes:

codesign -s '3rd Party Mac Developer Application: Apple Inc.' iTunes.app

codesign -d -vvvv iTunes.app

productbuild --component 'iTunes.app' /Applications --sign '3rd Party Mac Developer Installer: Apple Inc.' iTunes.pkg

Step 12
You should test your installation package created by productbuild. The .pkg file should have been created in the same directory as your application. If so, then delete your built application and then double-click on the .pkg file to run the installer. If all goes well, you should see your app installed in the Applications folder.

If you've included receipt validation, you'll want to test that now too. Create a test user in iTunes Connect -> Manage Users. Then, run your app. It should quit and ask you for an App Store account. Enter your test user you just created, and see if it validates and launches your app. Make sure you do this  after  you create the installation package. You don't want to upload your validated app to the app store (obviously).

Step 13
Create your App in iTunes Connect -> Manage your Applications. Click the "Add New App" button. Select "Mac OS X App". If you correctly completed Step 9, you'll be able to select your application's bundle ID. If you get the error "You have no eligible Bundle IDs for Mac OS X apps." then you have to do Step 9 over again.

Step 14
After filling out the meta for your app in iTunes Connect, click the blue "Ready to Upload Binary" button to indicate you intend to upload your application.

Step 15
Upload your .pkg file to iTunes Connect using Application Loader (part of Xcode). Launch Application Loader, and if you have completed all the steps correctly, there should be a drop-down menu containing your app(s). Select the one you want to upload, click next and follow the steps. If you get the message "No eligible applications were found." then you've done something wrong along the way. 

Step 16
Monitor the status of your app in iTunes Connect. A list of possible statuses is given in Appendix B. When your app's status is "Ready for Sale" you're done! Congratulations!

Part II: Managing your App Store Presence

Best Icon Practices
Your icon represents your application on most pages of the App Store. Whether your app is featured, topping some chart, or selected as a staff pick, your icon is the first impression users have of the quality of your work. Mac icons, unlike most Windows icons, are typically designed to be photo-realistic. This does not mean you should use a photograph of something as an icon, rather design a crisp, vector-based icon with realistic shadows, highlights, and contrast so that it appears almost as realistic as an object on your desk.

Image

It's been my personal observation that many independent developers treat their icons as little more than afterthought. This is a mistake if you plan to succeed on the Mac App Store. There are many tutorials and helpful Photoshop templates available online to make the best Mac-like icon you possibly can. Remember, Mac OS X is  not  Windows, and the Mac community's intolerance for low-quality work reflects this.

The icon image must be 512x512 pixels, but the  weight  of its graphical contents rarely occupies that entire space. Typically it's about 85% - 90% the width and height, and often shifted upwards by a few pixels off the centerline. Take the Dashboard icon as an example:

Image

Experiment with different dimensions until your icon sits in your dock more or less flush with other Apple icons.

Best Screenshot Practices
Apple requires you upload at least one screenshot to your Mac App Store submission. Screenshots must be .jpeg, .jpg, .tif, .tiff, or .png file that is 1280x800, or 1440x900 pixes, at least 72 DPI, and in the RGB color space.

Image

To easily take a screenshot on your Mac, you can press Command + Shift + 3 to take your save your entire screen as an image. For greater precision, hit Command + Shift + 4 to get a crosshairs cursor with which you can select an area of your screen. Even better, once you get the crosshairs, hit your space bar, and when your cursor turns into a camera, roll over and click a window you'd like to save as a picture, including its shadows with alpha transparency and all. Then, arrange them cleanly in Photoshop. This saves space that would otherwise be wasted with your own personal Menu Bar and Dock.

Screenshots needn't literally be screenshots. You can create a nice layout in Photoshop with images of your user interface, text boxes, diagrams, arrows etc.

Best Meta Description Practices
Your description should be a detailed, but not exhaustive description of your app's primary functionality and intended use. It's a good idea to offer suggestions for use, or hypothesize hypothetical situations where one might absolutely need your app. A bullet-pointed list of features is not a bad idea, but don't make it the only thing in your description. If you have other products that are related, be sure to mention how using a combination of your products would enhance a user's experience even further.

Image

Appendix A: Possible LSApplicationCategoryType Values

  • public.app-category.business
  • public.app-category.developer-tools
  • public.app-category.education
  • public.app-category.entertainment
  • public.app-category.finance
  • public.app-category.games
    • public.app-category.action-games
    • public.app-category.adventure-games
    • public.app-category.arcade-games
    • public.app-category.board-games
    • public.app-category.card-games
    • public.app-category.casino-games
    • public.app-category.dice-games
    • public.app-category.educational-games
    • public.app-category.family-games
    • public.app-category.kids-games
    • public.app-category.music-games
    • public.app-category.puzzle-games
    • public.app-category.racing-games
    • public.app-category.role-playing-games
    • public.app-category.simulation-games
    • public.app-category.sports-games
    • public.app-category.strategy-games
    • public.app-category.trivia-games
    • public.app-category.word-games
  • public.app-category.graphics-design
  • public.app-category.healthcare-fitness
  • public.app-category.lifestyle
  • public.app-category.medical
  • public.app-category.music
  • public.app-category.news
  • public.app-category.photography
  • public.app-category.productivity
  • public.app-category.reference
  • public.app-category.social-networking
  • public.app-category.sports
  • public.app-category.travel
  • public.app-category.utilities
  • public.app-category.video
  • public.app-category.weather

Appendix B: App Store Review Statuses

Prepare for Upload
You've take the first step to create your app (or an update). This is essentially a placeholder. You can use this time to proofread and change your meta description, upload screenshots, continue working on your app, etc. This just shows intent to eventually upload something.

Waiting for Upload
iTunes Connect is waiting for you to upload your signed package via Application Loader.

Upload Received
iTunes Connect has received your upload and is pre-checking some basic things before sending it off to reviewers.

Waiting for Review
Your app is waiting to be assigned to a reviewer.

In Review
Your app has been assigned to a reviewer and will be reviewed soon.

Processing for App Store
Your app has been approved by a reviwer and is being finalized for the Mac App Store.

Ready for Sale
Your app is now in the Mac App Store. If you have selected some date in the future, it will be invisible until that time.

Rejected
Your worst nightmare, or so it may seem at the time. Apple has rejected your app for not strictly adhering to the guidelines. They will always tell you what the problem is, but often will quit their review upon the discovery of the first problem. This unfortunately means if you fix the problem and resubmit, they may find another problem and reject again. Even more frustratingly, they will often overlook some problems while reliably rejecting for others. Thankfully, after dealing with Apple for a while you'll become accustomed for what to particularly look for. It will become like second nature.

Developer Rejected
You rejected your own app. This often happens when you submit, then discover a bug before review. You'll have to repeat the process all over again, and yes you'll be sent to the back of the queue.

Glossary

Apple Human Interface Guidelines
The ages-old and much-maligned document detailing Apple's user interface expectations of your software.

iTunes Connect
The web portal where you manage all your App Store particulars, such as the pricing and availability of your app, your app's appearance on the app store (meta description, screenshots), your distribution contracts with Apple, your banking information and your sales records.

Mac App Certificate
A digital certificate of authenticity you create in the Mac Developer Portal, download to your computer, and with which you sign your  apps .

Mac Installer Certificate
A digital certificate of authenticity you create in the Mac Developer Portal, download to your computer, and with which you sign your app  installers .

Mac Developer Portal
The web portal where you can find downloads, reference materials, and Apple's own developer forum. Also used to manage particulars of your Mac Developer Program, such as creating certificates.

Mac Developer Program
The program you subscribe to, giving you access the Mac Developer Portal, iTunes Connect, and qualify for distribution in the Mac App Store.

Receipt
A cryptographically signed record of download/purchase from the Mac App Store, supplied by Apple and located in your application bundle. Developers can optionally validate this receipt to thwart software piracy.

Receipt Validation
An anti-piracy measure of checking your receipt against the App Store account, Bundle ID and Mac Address of the computer from which the app was downloaded/purchased. Probably unnecessary for free apps. Caused controversy because Apple's original validation example did  not  check Bundle ID, making it easy to pirate by simply copying the receipt from another legitimately downloaded app. This vulnerability was famously exploited in the popular AngryBirds game on the very first day of the Mac App Store, making sensational headlines unfairly questioning the safety of the Mac App Store itself when in reality adding a check for Bundle ID renders the vulnerability invalid.

THIS IS A LIVING POST
Expect it to change as I continue working to improve it.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值