FireMonkey Development Setup for iOS
Go Up to FireMonkey Platform Prerequisites
A FireMonkey application destined for iOS is created and tested initially as a native Win32 application in RAD Studio. But the second half of the FireMonkey iOS app development process occurs on the Mac and on a test iOS device: That is, you do your production debugging on the Mac using the Xcode development platform, you compile the source files on the Mac using Free Pascal, and you run the iOS app using the Free Pascal RTL.
This topic describes the major setup steps that you need to do both in RAD Studio and on the Mac. However, this topic does not provide exact details for every step on the Mac, because the iOS Dev Center presents a slightly different workflow, according to the developer program that you join.
- For more information about the workflow on the Mac, see the Mac documentation at http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/000-Introduction/introduction.html
- For an overview of the entire workflow, from RAD Studio to the Mac and then to iOS, see Creating a FireMonkey iOS App.
iOS Requirements on Mac
- OS X 10.6 Snow Leopard or 10.7 Lion
- (Neither OS is supported on legacy PowerPC- and 680x0-based Macintosh systems. All Macs since 2007 are Intel-based; all since 2008 are 64-bit, which Lion requires.)
- Xcode and the iOS SDK installed.
- Requires membership in one of several Apple Developer Programs, which are described later in this topic.
- Xcode version 3.2.5 to 4.2 verified working.
- iOS SDK version 4.2.x, 4.3.x, or 5.0 verified working.
- iOS device connected to Mac by USB port
FMI (the FireMonkey library ported for iOS) requires the Free Pascal compiler (FPC), version 2.6.0. Free Pascal is installed for you as part of the steps described here.
Installing FireMonkey-iOS Tools on Mac
Perform the following installation procedure on your development Mac:
- Install Xcode on the Mac.
- Registering as a member of the iOS Developer Program is described further in this topic. After you register as a member of the iOS Developer Program, you can obtain a download of the specific required versions of Xcode and the iOS SDK by visiting: iOS Downloads
- Find the FireMonkey-iOS.dmg disk image file on your development PC and transfer it to the Mac.
- FireMonkey-iOS.dmg is typically installed in the RAD Studio installation location, under the directory:
-
FireMonkey-iOS
- On the Mac, open FireMonkey-iOS.dmg and run the two installer packages:
-
fpc-2.6.0.intel-macosx.pkg -
FireMonkey-iOS-XE2.pkg
-
This setup procedure performs the following:
- Installs Free Pascal 2.6.0 under
/usr/local/. - Copies Free Pascal 2.6.0 source to
/Developer/Embarcadero/fpc/. - Copies FMI source required for apps to
/Developer/Embarcadero/fmi/. - Generates, builds, and installs the required iOS SDK headers under
/Developer/Embarcadero/fpc/.- For more information about Xcode, see Connecting Your PC to a Mac.
After the initial installation, you must also complete the configuration of your development environment on the Mac, as described later in this topic.
Setting Your RAD Studio Environment
The following configuration steps will speed iOS development with RAD Studio.
Setting Autosave
FireMonkey iOS projects share project files with Xcode through the file system. Autosaving can avoid unnecessary round trips when you thought a file was saved for compiling but actually was not.
To enable autosaving, go to Tools > Options then select Environment Options and ensure that Editor files is checked in the Autosave options.
Using DPR2XCODE.EXE, the Tool to Export a DPR Project to Xcode (Required)
RAD Studio iOS projects must be exported as Xcode projects to run on the iOS simulator or iOS device. The dpr2xcode utility, installed in the /bin directory, performs this export for you.
You must run dpr2xcode at least once for each project to generate the initial Xcode project, and run dpr2xcode again whenever changes or additional files are added to the project. dpr2xcode saves the project files (the ones you need for iOS development on the Mac) in an xcode folder inside your project directory. You need to transfer the xcode folder to the Mac in order to continue iOS app development.
Automating DPR2XCODE (Optional but Recommended)
Adding a Tools menu item makes it easy to run dpr2xcode within RAD Studio. To automate dpr2xcode, follow these instructions:
- Go to Tools > Configure Tools.
- On the Tool Options dialog box, click Add.
- On the Tool Properties dialog box, complete the fields as follows:
- Title = Export to Xcode
- Program = dpr2xcode.exe
- Parameters = $PROJECT
Note: The FMI sources are typically installed in
/Developer/Embarcadero/fmi. If you did not install the FMI sources in this location, add the location in the Parameters field as follows:-fmi=/myFmiLocation $PROJECT.
- Click OK on the Tool Properties dialog box.
- Click either Close or X on the Tool Options dialog box.
After these steps, you can run dpr2xcode by selecting Tools > Export to Xcode.
To change the settings for the dpr2xcode macro or to delete the macro, return to the Tool Properties dialog box.
Here is the command-line help for dpr2xcode:
C:\Program Files\Embarcadero\RAD Studio\n.n\bin>dpr2xcode Convert Delphi Project to Xcode project for iOS Usage: drp2xcode [options] <file.dpr> -fpc=<FPC dir> -fmi=<FMI dir> -title=<Application Title>
Setting Up File Sharing for Mac and PC
Your project's files must be shared between RAD Studio and Xcode. To facilitate this sharing, you must store your files in a location that is accessible to both programs at the same time. You can do this in any of the following ways:
- A network file server
- A local folder shared by the PC and the Mac
- Your virtual machine environment if you are running Windows in a VM on your Mac
Note: We recommend that you set up a shared folder on the Mac and save your project files directly to the Mac from RAD Studio.
Setting Up Your iOS Development Environment on the Mac (Required)
In order to build, run, debug, and deploy iOS apps on the Mac, you need to join one or two Apple developer programs, obtain a code-signing certificate, and create provisioning profiles (all described in this section).
You can join a developer program in either of the following ways:
- As an individual developer.
- As a member (or leader) of a team in an enterprise (business) program or university program.
For more information about the developer programs, see http://developer.apple.com/programs/which-program/. After you join a program and log in using your Apple Developer ID, you will find the appropriate platform- and program-specific documentation available to you. Please use the Apple documentation as your principal guide.
Keep in mind that the requirements are set by Apple Computers, so the steps described here might not be entirely accurate in your current situation. The entire process of configuring your Mac and iOS devices for app development and testing is perhaps more accurately described in the Apple documentation at: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/100-Configuring_Your_Development_Assets/identities_and_devices.html#//apple_ref/doc/uid/TP40007959-CH4-SW2
Note: FireMonkey iOS apps can be installed on any iPhone without going through the Apple App Store by using so called AdHoc deployment. You can also use Xcode and a USB cable to deploy apps to connected iOS devices.
Acquire Your Apple ID and iTunes Account (Required)
In order to buy apps (from the App Store) or music (from the iTunes Store), you need to acquire an Apple ID (free) and open an iTunes account. See iTunes: How to set up an iTunes Store account (Apple ID).
- For information about marketing your completed iOS apps, including guidelines for submission to the App Store, see Prepare for App Submission.
- ARM v. 7 is now required for iOS apps to be accepted in the App Store. For information about updating from ARM v. 6 to v. 7, see Anders Ohlsson's blog at http://blogs.embarcadero.com/ao/2012/04/15/39251.
Join the Apple Developer Program (Required; Registration is free)
- Gives you your Apple Developer ID. A Registered Apple Developer user ID is required for iOS application development.
- Gives you access to the basic software tools (such as Xcode and iOS SDK) that you need in order to develop applications on the Mac platform (part of FireMonkey iOS development occurs on the Mac).
- Enables you to test your iOS apps using simulators in Xcode.
- Gives you the Apple documentation about iOS development.
- Allows you to report bugs and attend Apple developer events.
Join the iOS Developer Program (Requires an annual payment of $99 to Apple)
- Gives you access to developer tools, pre-release software, and technical support
- Enables you to place your completed iOS applications in the Mac App Store.
- Gives you access to the portal through which you create the Development Provisioning Profile, which is necessary for running your applications to development iOS devices.
- There are separate developer programs for Enterprise (business) and for University.
- For information about joining the iOS Developer's Program, see http://developer.apple.com/support/ios/enrollment.html.
Note: A similar program is Mac Developer Program, for Mac developers.
- If you want to develop for both the Mac and iOS and place your Mac and iOS apps in the App Store, you need to join both developer programs (Mac and iOS).
- If you plan to place only your iOS apps (not any Mac apps) in the App Store, you can join only the iOS Developer Program.
Request, Download, and Install Your Code-Signing Certificate (Required)
The code-signing certificate is a digital signature that associates you and your digital identity with your applications.
On the Mac, create and submit a request for an iOS development certificate. General information is here: http://developer.apple.com/library/ios/#documentation/Xcode/Conceptual/ios_development_workflow/100-Configuring_Your_Development_Assets/identities_and_devices.html#//apple_ref/doc/uid/TP40007959-CH4-SW7
For specific instructions customized for your developer login, log into the iOS Dev Center
Your developer program determines the sequence and requirements that you need. For example, the following pages (in this case, about acquiring certificates) are available only to users logged in to a specific developer program:
- Using an Individual developer login: http://developer.apple.com/ios/certificates/howto.action
- Using a Team member developer login: http://developer.apple.com/ios/my/certificates/howto.action
- Using a Team leader login: http://developer.apple.com/ios/manage/certificates/howto.action
Create an App ID for Your iOS App (or for a group of iOS apps) (Required)
On the Mac, see an overview at http://developer.apple.com/library/ios/#documentation/General/Conceptual/DevPedia-CocoaCore/AppID.html
Consult your iOS Dev Center for specific instructions.
Create 'Provisioning Profiles' for Developing and Distributing Your iOS Apps Using the Mac (Required)
In order to build, run and debug iOS apps on the Mac, you need to create a Development Provisioning Profile. Also, in order to distribute iOS apps in the App Store, you need to create a Distribution Provisioning Profile on the Mac.
iOS Device ID Required: To obtain a Provisioning Profile, you need to supply the 40-character UDID of your iOS device. You can find the UDID through Xcode or iTunes on the Mac when your iOS device is connected. For more info, see https://developer.apple.com/ios/my/devices/howto.action (requires iOS Developer Program login)
Using Xcode on the Mac, create your Development Provisioning Profile for your iOS apps and devices:
- Associates your iOS apps with the individual iOS devices that you want to use in testing:
Useful Apple URLs:
- For information about developing iOS apps, see iOS Development Workflow (Apple).
See Also
- Connecting Your PC to a Mac
- FireMonkey Platform Prerequisites
- Creating a FireMonkey iOS App
- Mac OS X Application Development
- Creating a FireMonkey Application
- iOS Developer Library
- iOS Developer Library: Getting Started
- iOS Dev Center
- Provisioning an iOS Device
- Preparing Your iOS App for Distribution in the App Store
- iAd Network