Running Your iOS Application on an iOS Device

From RAD Studio
Jump to: navigation, search

Go Up to iOS Mobile Application Development

You can run your Delphi or C++ iOS app on an iOS device only after you have successfully completed the following steps:

The following is a conceptual illustration of the iOS development process, including the connection to an iOS device:

Win2Mac2iOSDevice.png

Steps to Run Your App on an iOS Device

Connect your iOS device to your Mac with an Apple USB cable
  1. Run the Platform Assistant on the Mac.
  2. Test the connection to your Mac (on the Connection Profile Manager page).
  3. Connect an iOS device (such as an iPhone or an iPad) to your Mac using the Apple standard USB cable (illustrated on the right).
    Note:
    • Only one iOS device should be connected to the Mac at one time.
    • In some cases, your iOS SDK version does not need to match the iOS device version. For example, you can build your app with the iOS 6.x SDK, and your app can run on a 5.x device.
  4. In RAD Studio:
    1. In the Project Manager, expand the Target Platforms node and double-click the iOS Device target platform to select that platform. The selected target platform is displayed using a bold font.
    2. In the Target Platforms node, expand the iOS Device node, expand the Configuration node, and double-click the Debug platform configuration to select it. The selected platform configuration is displayed using a bold font.
      Note: You cannot run applications directly from RAD Studio into an iOS Device if you build them with the Ad hoc or the Application Store platform configurations. To run applications deployed for ad hoc distribution, see Deploying Your iOS Application for Ad hoc Distribution. To run apps built for the App Store, you must install them from the App Store.
    3. Run your app, either with debugging (Run > Run) or without debugging (Run > Run Without Debugging).

RAD Studio builds your app using the SDK you previously added to the IDE, connects to your Mac using the connection profile you configured for the iOS Device platform, and the Platform Assistant on the Mac launches your application on the connected iOS device.

Note: RAD Studio might look frozen at some points until it launches your app on your iOS device, but it is just preparing to run your app.

Troubleshooting

For 'Device connection timeout,' please connect your iOS device to your Mac

If your iOS device is not connected, you see the following message in the IDE after you attempt to launch your app on an iOS device:

 Device connection timeout

If you see this message, do the following:

  1. Dismiss the message.
  2. Connect your iOS device to the Mac using an Apple USB cable (shown above).
  3. Run your app again from the IDE. See the steps given above.
Note: The PAServer command-line utility allows you to set a device connection timeout using the -devicetimeout=<n>. However, setting a different device timeout value does not solve the problem in the case of a missing iOS device.

'Unable to locate DeviceSupport directory matched with connected device info'

If you have recently upgraded the iOS version of your device, you might get the error message above when you try to run your app on your iOS device. If you see this message, do the following:

  1. Dismiss the message.
  2. On the Mac, open Xcode.
  3. Select Window > Organizer and determine whether Xcode recognizes your device:
    • If Xcode recognizes your device, let Xcode re-import your device support information, and try running your application from RAD Studio again.
    • If Xcode does not recognize your device, you must upgrade Xcode.
      Note: Alternatively, if Xcode does not recognize your device, but you do not want to upgrade Xcode in your Mac, you may try connecting your device to a different Mac which does have an upgraded version of Xcode that recognizes your device. After you let a newer version of Xcode re-import your device support information, an older version of Xcode might recognize your upgraded iOS device as well.

Nothing Shows Up in the iOS Device

If after you follow the steps to run your app on an iOS device, the app does not show up in your iOS device, check the following:

  • The Platform Assistant must be running on the Mac. See Running the Platform Assistant on a Mac:
  • On RAD Studio, the connection profile associated with the iOS Device target platform must connect with the target instance of the Platform Assistant.
    • See Activating and Configuring the Target Platform for instructions on how to configure the connection profile associated with the iOS Device target platform in your project.
    • On the Tools > Options > Environment Options > Connection Profile Manager page:
      • Select the connection profile associated with the iOS Device target platform from the left-hand column (which lists the available connection profiles, grouped by platform).
      • Check the values of that connection profile, such as the IP address (it must be your Mac's IP address) and the port number (it must be the Platform Assistant's port number).
      • Click Test Connection to ensure your development PC has a working connection to the Platform Assistant that is running on the Mac.
  • Only one iOS device should be connected to the Mac at one time.

My App Does Not Stop at Breakpoints Anymore

After a crash during a debugging session on an iOS device, it might happen that the next debugging sessions do not work anymore on your iOS device.

If when you run with debugging symbols your application runs but never stops at any breakpoint, do the following:

  1. On your Mac, launch Xcode.
  2. On Xcode, create a new iOS application.
  3. With your new Xcode iOS application open, select iOS Device as your target.
    XcodeIosDeviceTarget.png
  4. Click and hold Run, and select Analize from the context menu that appears.
    XcodeAnalize.png

You can now close Xcode and continue using your iOS device to debug RAD Studio applications.

See Also