Talk:MacOS Application Development
Contents
Sandboxing Required for OS X Apps
- Sandboxing restricts access to system resources and is one way that Apple ensures that apps are safe and do not contain any malware.
- All apps distributed through the Mac App Store must be sandboxed as of March 1, 2012.
- For more information, see https://developer.apple.com/devcenter/mac/app-sandbox/ (requires an Apple ID, as described in #Acquiring the Required Apple IDs).
On the Mac, you need to create a ProjectName.entitlements file and place it in the application bundle, codesign the bundle, package the bundle, and submit it to Apple. Here are the elements you need, and the relevant information from Apple:
- entitlements XML file
- codesign:
- man page for codesign command
- Code Signing Guide
- Code Signing Your App
- For example:
codesign -s"Certificate Name" -f "Application Bundle Name"
- productbuild
- installer (for testing the installation of your application)
- Submit your application to the Mac App Store
Developing and Testing of OS X and iOS Apps and Self-distibution of OS X Apps
Developing, testing and self-distribution of OS X apps does not require you to either register or otherwise join the Apple Developer Program. Neither Xcode nor your computer need any form of registration. You will, however, need to obtain an Apple ID in order to be able to download the XCode IDE from the App Store.
iOS apps can likewise be developed and tested on the simulator without having to register for the iOS Developer Program but, to test on a device, you will need to join the iOS Developer Program.
Even though you do not need to join either the iOS or the Mac Developer Programs unless you want to test iOS apps on a device or distribute your apps via the appropriate App Store, joining does entitle you to access a wealth of developer resources otherwise unavailable.
Testing of iOS Apps on a Device and Distribution of iOS and OS X Apps via the App Store
Acquiring the Required Apple IDs
You need several IDs, available from and subject to change by Apple Computers, as follows:
- Apple ID and iTunes: In order to buy apps (from the Mac App Store) or music (from the iTunes Store), you need to acquire an Apple ID (free) and an iTunes account (free):
- Mac: In order to distribute your Mac apps in the Mac App Store, you need to:
- Acquire an Apple Developer ID (free)
- Join a Mac Developer Program ($99/year for an individual developer)
- iOS: In order to test apps on iOS devices (iPod, iPhone, and iPad) and to distribute your iOS apps in the iOS App Store, you need to:
- Acquire an Apple Developer ID (free)
- Join an iOS Developer Program ($99/year for an individual developer)
Note: At XE2, only Delphi FireMonkey applications can be created for iOS. For more information, see "FireMonkey_Development_Setup_for_iOS" in the XE2 docwiki.
The developer programs for Mac and for iOS provide you with access to tutorial videos, online documentation, and support. Separate programs are available for individuals, companies, and universities, and registration for the group programs costs less per person than for an individual developer.
Sandboxing Required for OS X Apps
- Sandboxing restricts access to system resources and is one way that Apple ensures that apps are safe and do not contain any malware.
- All apps distributed through the Mac App Store must be sandboxed as of March 1, 2012.
- For more information, see:
- https://developer.apple.com/devcenter/mac/app-sandbox/ (requires an Apple ID, as described in #Acquiring the Required Apple IDs)
- App Sandbox Design Guide
On the Mac, you need to create a ProjectName.entitlements file and place it in the application bundle, codesign the bundle, package the bundle, and submit it to Apple. Here are the elements you need, and the relevant information from Apple:
- entitlements XML file
- codesign:
- man page for codesign command
- Code Signing Guide
- Code Signing Your App
- For example:
codesign -s"Certificate Name" -f "Application Bundle Name"
- productbuild
- installer (for testing the installation of your application)
Codesigning and Building Your Mac Application on the Mac
These steps are required if you want to submit your application to the Mac AppStore.
Notes:
- Ensure that you obtain a distribution certificate for submitting apps to the Mac AppStore from http://developer.apple.com/certificates.
- You will need an Apple Developer Account to do this.
- Ensure that the certificate is installed in your Keychain (double-click the
.cer
file in the Finder).- You will need an entitlements.xml file for Mac sandboxing.
- Build your application in the IDE and deploy it to Mac OS X (Snow Leopard or Lion).
- Open a terminal window on the Mac.
- Switch to the paserver's scratch-dir, for example:
Applications/Embarcadero/PAServer/scratch-dir/machinename-profilename/
- Run the following commands:
- Codesign your application:
sudo codesign -f -v -s "Mac Developer: FirstName LastName" "AppName.app"
- Create an installer package:
sudo productbuild --component "AppName.app" /Applications --sign "Mac Developer: FirstName LastName" --product "AppName.app/Contents/info.plist" AppName.pkg
Response
Thank you, Joanna, for your corrected information. We have incorporated your suggested changes.
Kris Houser Lead Writer, RAD Studio
RAD-10666