Connecting iOS Devices

You can connect iOS devices to a Mac computer with a USB cable to build and run applications on them from Qt Creator.

To be able to use Qt Creator on macOS, you must install Xcode, and therefore, you already have the tool chain for building applications for iOS. Qt Creator automatically detects the tool chain and creates the necessary kits for building and running applications on configured iOS devices.

You only need Qt libraries that are built for iOS. You can install them as part of Qt 5.2, or later.

Configuring Devices

The process of configuring devices and the UI varies slightly depending on the Xcode version that you use. The instructions in this section describe the process and UI when using Xcode version 4.6.3.

To configure connections between Qt Creator and an iOS device:

  1. Make sure that you have Xcode and Qt for iOS installed.
  2. Connect the device to the Mac computer with a USB cable.
  3. Start Xcode to configure the device:
    1. Select Window > Organizer.
    2. Select the + button to add the connected device.
    3. Select the device you want to add in the list of devices.
    4. If you do not have an Apple developer account, you can now create one, for a charge.
    5. When your account is ready, you can add the device. Your Apple developer certificate is copied to the device.
    6. The first time you connect the device, you are asked to enable developer mode on the device.

    The connections between Qt Creator and an iOS device are protected by using an iOS Developer Program certificate that you receive from Apple for a charge when you enroll in the iOS Developer Program. The certificate is copied to the device when you configure the device.

    The next time you connect the device to the Mac computer, Qt Creator detects it automatically. To disable automatic connections to a device that you do not use for development, select Preferences > iOS, and deselect the Ask about devices not in developer mode check box.

    Note: If Qt Creator does not detect the devices, the iOS plugin might not be enabled. Select Qt Creator > About Plugins > Device Support > iOS and restart Qt Creator.

  4. To specify build settings:
    1. Open a project for an application you want to develop for the device.
    2. Select Projects > Build & Run > Add Kit to add a kit for building and running applications on iOS.

      "Build & Run Settings"

  5. Select Run to specify run settings.

    Usually, you can use the default settings.

    When you run the project, Qt Creator uses Xcode to deploy the application to the device.

    Your signing certificate is used to sign application packages for deployment to the device.

Note: If you cannot deploy applications, because a provisioning profile is missing, try refreshing the list of provisioning profiles in Xcode. Select Xcode > Preferences > Accounts > View Details, and then select the Refresh button.

Viewing Device Connection Status

When you connect an iOS device to a Mac computer with USB, Qt Creator automatically detects the device if you have configured it by using Xcode. To view information about the connected device, select Preferences > Devices.

"Devices dialog"

If the current device state is Connected, (the traffic light icon is orange), you need to configure the device using Xcode.

Testing on iOS Simulator

If you do not have an iOS device or you do not want to create an account, you can test applications on iOS Simulator, which is installed as part of Xcode. Each Xcode version simulates a predefined set of hardware devices and software versions.

You can change the simulated hardware and software version in the run settings for the project. Select Projects > Run, and then select the device to simulate in the Device type field.

Qt Creator uses the Xcode version set as current on the Mac computer. To check the version, enter the following command:

xcode-select --print-path

To change the version, enter the following command:

xcode-select --version

© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.