Running Your iOS Application on an iOS Device
Go Up to iOS Mobile Application Development
- 1 Steps to Run Your App on an iOS Device
- 2 Running Your Application with Clean Data and Cache Folders
- 3 Troubleshooting
- 3.1 For 'Device connection timeout,' please connect your iOS device to your Mac
- 3.2 'Unable to locate DeviceSupport directory matched with connected device info'
- 3.3 Nothing Shows Up in the iOS Device
- 3.4 My App Does Not Stop at Breakpoints Anymore
- 3.5 [DCC Error] E2597 ld: file was built for armv7
- 3.6 Synchronizing the Xcode with Your iOS Device
- 3.7 My App Crashes
- 4 See Also
You can run your Delphi or C++ iOS app on an iOS device only after you have successfully completed the following steps:
- Configure your development environment for iOS application development.
- Create a development provisioning profile for your application.
- Complete the Provisioning page for the Development platform configuration.
The following is a conceptual illustration of the iOS development process, including the connection to an iOS device:
Steps to Run Your App on an iOS Device
- Run the Platform Assistant on the Mac.
- Test the connection to your Mac (on the Connection Profile Manager page).
- Connect an iOS device (such as an iPhone or an iPad) to your Mac using the Apple standard USB cable (illustrated on the right).
- In RAD Studio:
- In the Projects Window, expand the Target Platforms node and double-click the iOS Device - 64 bit target platform. The selected target platform is displayed using a bold font.
- In the Target Platforms node, expand the selected iOS device node, expand the Configuration node, and double-click the Development platform configuration to select it. The selected platform configuration is displayed using a bold font.
- Run your app, either with debugging (Run > Run) or without debugging (Run > Run Without Debugging).
RAD Studio builds your app using the SDK that you previously added to the IDE, connects to your Mac using the connection profile that you configured for the selected iOS device target platform, and the Platform Assistant on the Mac launches your application on the connected iOS device.
- The first time that you use a user account on your Mac to run an application on an iOS device, your Mac will prompt you to allow RAD Studio to sign applications using your private key. You must accept this on your Mac so that RAD Studio can continue running your application on your iOS device.
- 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.
Running Your Application with Clean Data and Cache Folders
When you run an application on an iOS device, RAD Studio installs your application on your device using the
CFBundleIdentifier value that you defined in the Version Info options page to uniquely identify your application. By default, the
CFBundleIdentifier value is "$(ModuleName)", which is the name of your project, such as "Project1".
If you run your application on a device that already contains a previously-installed application with the same
CFBundleIdentifier value as the application that you want to run, the Run command reinstalls your application, but only updates the application executable; the data and cache folders of your application are not updated.
To configure RAD Studio so that the Run Without Debugging and Run actions completely uninstall any previously-installed version of your application, including the data and cache folders, before installing the newer version:
- Select Run > Parameters.
- Enter "-cleaninstall" in the Parameters field:
- Click OK to save your changes.
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:
- Dismiss the message.
- Connect your iOS device to the Mac using an Apple USB cable (shown above).
- Run your app again from the IDE. See the steps given above.
'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:
- Dismiss the message.
- On the Mac, open Xcode.
- 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.
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 selected iOS device target platform (iOS Device - 64 bit) 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 an iOS device target platform in your project.
- On the Tools > Options > Environment Options > Connection Profile Manager page:
- Select the connection profile associated with the selected 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 the IP address of your Mac) and the port number (it must be the port number of the Platform Assistant).
- Click Test Connection to ensure that your development PC has a working connection to the Platform Assistant that is running on the Mac.
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:
- On your Mac, launch Xcode.
- On Xcode, create a new iOS application.
- With your new Xcode iOS application open, select iOS Device as your target.
- Click and hold Run, and select Analize from the context menu that appears.
You can now close Xcode and continue using your iOS device to debug RAD Studio applications.
[DCC Error] E2597 ld: file was built for armv7
[DCC Error] E2597 ld: file was built for armv7 which is not the architecture being linked (arm64): C:\Users\<user>\Documents\Embarcadero\Studio\SDKs\iPhoneOS7.0.sdk/usr/lib/libiconv.dylib for architecture arm64
This error occurs when you try to build an application for the iOS Device - 64 bit target platform using the 7.0 version of the iOS SDK. RAD Studio does not support versions of the iOS SDK lower than 8.0. Make sure that you have the latest version of Xcode installed on your Mac, and add a supported iOS SDK to RAD Studio.
Synchronizing the Xcode with Your iOS Device
You need to ensure that the Xcode that is installed in the Mac supports the iOS version of the iOS device, and that they are synchronized. You can follow these steps to synchronize the Xcode in the Mac and your iOS device:
- Unplug your iOS device from the Mac.
- Open Xcode on your Mac.
- From the main menu, select Window, Devices.
- Attach your iOS device back to the Mac.
- On the Devices window, select your iOS device on the left-hand side of the window.
- Wait for the loading wheel to disappear. When it does, you can close Xcode and try to debug your application again.
My App Crashes
Your application may crash on your iOS device if you build your application with a version of the iOS SDK that is higher than the version of iOS that your device is running. For example, if you build your application using version 9 of the iOS SDK, and you run your application on a device running iOS 8, your application might crash. If this is the case, change the iOS SDK that RAD Studio uses to build your application for iOS.