Mobile Tutorial: Set Up Your Development Environment on the Mac (iOS)

From RAD Studio
Jump to: navigation, search

Go Up to Mobile Tutorials: Mobile Application Development (iOS and Android)


A FireMonkey Delphi application destined for the iOS target platform can be optionally tested on the iOS Simulator available on the Mac. FireMonkey C++ and Delphi applications can be tested using the iOS Device target platform; this testing requires a test iOS device connected to the Mac.

  • The first half of this tutorial describes the steps that you need to perform in order to run your iOS application (Delphi only) on the iOS Simulator on the Mac.
  • The second half of this tutorial describes additional steps required in order to run your iOS application (Delphi or C++) on your iOS Device.
Note: The iOS Simulator is not supported by BCCIOSARM. Only iOS devices are supported by BCCIOSARM.

Requirements on the Mac and iOS

  • 10.12 Sierra
  • 10.13 High Sierra
  • 10.14 Mojave
  • 10.15 Catalina
    (Neither OS is supported on legacy PowerPC- and 680x0-based Macintosh systems. All Macs since 2007 are Intel-based; all Macs since 2008 are 64-bit.)
  • For MacOS development, the latest version of Xcode
  • For iOS development, the latest version of the iOS SDK and Xcode installed, along with the Xcode command line tools.
Note: RAD Studio does not support versions of the iOS SDK lower than 8.0.

Steps to Configure Your Mac to Run Your iOS Application

To deploy an iOS application to your device for debugging and testing purposes, your system should have the configuration shown in the following figure. RAD Studio runs on a Windows PC computer. This PC computer is connected to a Mac running the Platform Assistant and having installed the appropriate versions of Xcode and iOS SDK (for iOS development). To run iOS apps on an iOS device, the iOS device should be connected via USB cable to the Mac.

Win2Mac2.png


To deploy an iOS application to the iOS Simulator on the Mac or to an iOS device, you need to install the following tools on your Mac:

Step 1: Install the Platform Assistant

The Platform Assistant must be running on the Mac when you deploy an iOS app from your PC to either the iOS simulator or an iOS device.

The macOS installer for the Platform Assistant is named PAServer23.0.pkg and it is available in two places:

Installing PAServer

For further details, see Installing the Platform Assistant on a Mac.

Step 2: Run the Platform Assistant

In the Finder on the Mac, activate the .app file (PAServer-23.0.app) as follows:

  1. Navigate to the top-level Applications folder.
  2. Double-click PAServer-23.0.app to start the Platform Assistant:
    SelectNewRADPAServer.png

    The Terminal window appears, displaying the Platform Assistant banner and the password prompt:

    Connection Profile password <press Enter for no password>

    Either press Return, or enter a password for PAServer and then press Return.
  3. Next you are prompted to enter your Mac user password to allow the Platform Assistant to debug (take control of another process) your application.

    TakeControl.png

    Enter your password, and select Take Control:

    PAServer sign-on message

For more details about running the Platform Assistant, see Running the Platform Assistant on a Mac.

Step 3: Install Xcode on the Mac

Xcode is the development and debug environment on the Mac, and provides the required development files for macOS and iOS applications.

You can install Xcode from any of the following sources:


Next Steps

You have configured your Mac to run an iOS application on the iOS Simulator.

Note: Only Delphi applications can be run on the iOS Simulator. C++Builder does not support the iOS Simulator.

WhiteSpace50.png

Additional Steps to Configure Your Mac to Run Your iOS Application on Your iOS Device

The following additional steps enable you to run your iOS application on your iOS Device.

Win2Mac2iOSDevice2.png


Remember that your iOS device should be connected to your Mac via USB cable.

Step 1: Make Sure that the Xcode Command Line Tools Are Installed on Your Mac

Note: Beginning with Xcode version 6.1, the Xcode Command Line Tools are automatically installed during Xcode installation.

To make sure that the Xcode command line tools are installed on your Mac:

  1. Start Xcode on the Mac.
  2. Choose Preferences from the Xcode menu.
    XcodePreference.png
  3. In the General window, click the Locations tab.
  4. On the Location window, check that the Command Line Tools shows the Xcode version (with which the Command Line Tools were installed). This means that the Xcode Command Line Tools are already installed and you do not need to install them.
    XcodeLocations.png
  5. If the Xcode Command Line Tools are not installed, the Command Line Tools do not show the Xcode version.
    1. In this case, click the Downloads tab on the Location window.
    2. On the Downloads window, choose the Components tab.
      InstallingiOSCommandLineTools.png
    3. Click the Install button next to Command Line Tools.
    You are asked for your Apple Developer login during the install process.

For more details, see Installing the Xcode Command Line Tools on a Mac.

Step 2: Sign Up for a Developer Account

Membership in the Apple Developer Program is a requirement for building, running, debugging, and deploying applications for iOS.

Follow the steps described at Joining the Apple Developer Program.

Step 3: Request, Download and Install Your Development Certificate

Applications that are deployed on the device (or on the iOS Simulator) need to be cryptographically signed before they run. The Development certificate contains information that is needed for signing the applications. Each individual (an individual developer or a team member) must have a unique development certificate, which can be used for multiple applications.

For development teams, development certificates must be requested by each team member, and these requests must be approved by a team admin.


Request, Download and Install Your Certificate

  1. In the Keychain Access application on your Mac, select from the Keychain Access menu: Certificate Assistant > Request a Certificate From a Certificate Authority:
    RequestCertificateDev.png

    • If you are a development team member for a corporate/organization program, your team administrator needs to approve your request. After your team administrator approves it, you can download the certificate.
    • If you are an individual developer, you should see a download option for your certificate shortly after you request it. See Apple documentation at: Code Signing Guide for details.
    Save the certificate request as a CSR file, and then send it to your Certificate Authority through the iOS provisioning portal in the following way:
    1. When prompted, enter your Apple ID and password, and then click Sign In.
    2. Under iOS Apps, click Certificates.
    3. On the page that opens, click the plus sign (+) icon.
      This opens the Add iOS Certificate wizard.
    4. On the Select Type page, click Continue and follow the onscreen instructions to proceed with the wizard.
    5. When prompted, upload the CSR file that you saved on your Mac.
  2. Go to iOS Provisioning Portal. You can download the Development certificate clicking the Download button as shown below:
    DownloadDevelopmentCertificate.png

  3. Launch the Development Certificate by double-clicking it. It automatically loads in the Keychain Access application.

Step 4: Register Your Device for Deployment

Before a device can run user applications, it must be registered in the Apple Provisioning Portal. Devices are registered by their Unique Device ID (UDID). The UDID can be determined using Xcode, as follows:

  1. Make sure your iOS device is connected to your Mac machine.
  2. Open Xcode and go to Devices (Window > Devices).
  3. Click on your device.
  4. Next to the Identifier label is a string of characters:
    DeviceUDID.png

    The Identifier string represents your device's UDID.

Step 5: Create and Install a Provisioning Profile

Provisioning profiles are used for linking a developer and devices to a development team. This provisioning profile is required for running applications on an iOS device.

After your provisioning profile is created, you must install it into Xcode, as follows:

  1. Open Xcode on the Mac and go to the Devices (Window > Devices).
  2. Right-click the device and select Show Provisioning Profiles…
    ShowProvisioningProfiles.png

  3. Click the plus sing button to add a provisioning profile.
    PlusButtonAddProvisioningProfiles.png

  4. Find your provisioning profile, select it and click Install.
  5. Click Done to close the window.

You have configured your Mac to run your iOS application on your iOS Device.

To run your iOS application, please see Mobile Tutorial: Set Up Your Development Environment on Windows PC (iOS) and complete the configuration of your RAD Studio IDE. (If you have configured your PC as part of running your application on the iOS Simulator, you can skip this step.)

See Also