creator-ios-dev.qdoc 5.75 KB
Newer Older
Leena Miettinen's avatar
Leena Miettinen committed
1 2
/****************************************************************************
**
3 4
** Copyright (C) 2016 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
Leena Miettinen's avatar
Leena Miettinen committed
5
**
6
** This file is part of the Qt Creator documentation.
Leena Miettinen's avatar
Leena Miettinen committed
7
**
8 9 10 11 12 13 14
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see https://www.qt.io/terms-conditions. For further
** information use the contact form at https://www.qt.io/contact-us.
Leena Miettinen's avatar
Leena Miettinen committed
15
**
16
** GNU Free Documentation License Usage
Leena Miettinen's avatar
Leena Miettinen committed
17 18
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
19 20 21 22
** Foundation and appearing in the file included in the packaging of
** this file. Please review the following information to ensure
** the GNU Free Documentation License version 1.3 requirements
** will be met: https://www.gnu.org/licenses/fdl-1.3.html.
Leena Miettinen's avatar
Leena Miettinen committed
23 24 25 26 27
**
****************************************************************************/

    /*!

28
    \contentspage {Qt Creator Manual}
Leena Miettinen's avatar
Leena Miettinen committed
29 30
    \previouspage creator-developing-generic-linux.html
    \page creator-developing-ios.html
31
    \nextpage creator-developing-qnx.html
Leena Miettinen's avatar
Leena Miettinen committed
32 33 34 35

    \title Connecting iOS Devices

    You can connect iOS devices to a Mac computer with a USB cable to
36
    run applications built for them from \QC.
Leena Miettinen's avatar
Leena Miettinen committed
37

38
    To be able to use \QC on \macos, you must install Xcode, and therefore,
Leena Miettinen's avatar
Leena Miettinen committed
39 40
    you already have the tool chain for building applications for iOS. \QC
    automatically detects the tool chain and creates the necessary
41
    \l{glossary-buildandrun-kit}{kits} to build applications for and run them on
Leena Miettinen's avatar
Leena Miettinen committed
42 43 44 45 46 47 48
    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.

    \section1 Configuring Devices

49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
    The connections between \QC and an iOS device are protected by using a
    certificate that you receive from Apple when you
    \l{https://developer.apple.com/programs/enroll/}
    {enroll in the Apple Developer Program}. The certificate is copied to
    the device when you configure the device.

    The first time you connect the device to the Mac, you are asked to enable
    developer mode on the device. The next time you connect the device, \QC
    detects it automatically. To disable automatic connections to a device that
    you do not use for development, select \uicontrol Preferences >
    \uicontrol iOS, and deselect the \uicontrol {Ask about devices not in
    developer mode} check box.

    \note The process of configuring devices and the UI varies slightly
    depending on the Xcode version that you use. We recommend that you use the
    latest available Xcode version.
Leena Miettinen's avatar
Leena Miettinen committed
65 66 67 68 69

    To configure connections between \QC and an iOS device:

    \list 1

Leena Miettinen's avatar
Leena Miettinen committed
70 71 72
        \li Make sure that you have Xcode and Qt for iOS installed.

        \li Connect the device to the Mac computer with a USB cable.
Leena Miettinen's avatar
Leena Miettinen committed
73

74
        \li Start Xcode to configure the device.
Leena Miettinen's avatar
Leena Miettinen committed
75

76 77 78
            For example, in Xcode version 7.3.0, select \uicontrol Window >
            \uicontrol Device > \uicontrol + > \uicontrol {Add Device} to add
            the connected device.
Leena Miettinen's avatar
Leena Miettinen committed
79

Leena Miettinen's avatar
Leena Miettinen committed
80 81 82 83 84 85 86
        \li To specify build settings:

        \list 1

            \li Open a project for an application you want to develop for the
                device.

87
            \li Select \uicontrol Projects > \uicontrol {Build & Run} to select
88
                the kit for building applications for and running them on iOS.
Leena Miettinen's avatar
Leena Miettinen committed
89

Leena Miettinen's avatar
Leena Miettinen committed
90 91
                \image qtcreator-ios-add-kit.png "Build & Run Settings"

Leena Miettinen's avatar
Leena Miettinen committed
92 93
        \endlist

94
        \li Select \uicontrol Run to specify run settings.
Leena Miettinen's avatar
Leena Miettinen committed
95 96 97 98 99 100 101 102 103 104 105

            Usually, you can use the default settings.

    When you run the project, \QC uses Xcode to deploy the application to the
    device.

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

    \endlist

106
    \note If you cannot deploy applications, because a provisioning profile is
107 108 109 110
    missing, check that provisioning profiles are listed in Xcode by selecting
    \uicontrol Xcode > \uicontrol Preferences > \uicontrol Accounts >
    \uicontrol {View Details}. For more information about how to acquire and
    install a provisioning profile, see Apple documentation.
111

Leena Miettinen's avatar
Leena Miettinen committed
112 113 114 115
    \section1 Viewing Device Connection Status

    When you connect an iOS device to a Mac computer with USB, \QC
    automatically detects the device if you have configured it by using Xcode.
116 117
    To view information about the connected device, select \uicontrol Preferences >
    \uicontrol Devices.
Leena Miettinen's avatar
Leena Miettinen committed
118 119 120

    \image qtcreator-ios-device-configurations.png "Devices dialog"

121
    If the current device state is \uicontrol Connected, (the traffic light icon is
Leena Miettinen's avatar
Leena Miettinen committed
122 123 124 125 126 127 128 129
    orange), you need to configure the device using Xcode.

    \section1 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
    \l{http://developer.apple.com/library/ios/documentation/IDEs/Conceptual/iOS_Simulator_Guide/Introduction/Introduction.html}
    {iOS Simulator}, which is installed as part of Xcode. Each Xcode version
130 131 132
    simulates a predefined set of hardware devices and software versions.

    You can change the simulated hardware and software version in the run
133 134
    settings for the project. Select \uicontrol Projects > \uicontrol Run, and then select
    the device to simulate in the \uicontrol {Device type} field.
Leena Miettinen's avatar
Leena Miettinen committed
135 136 137 138 139 140 141 142 143 144

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

    \c {xcode-select --print-path}

    To change the version, enter the following command:

    \c {xcode-select --version}

Leena Miettinen's avatar
Leena Miettinen committed
145
*/