2013-09-11 12:32:20 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2019-10-11 15:02:52 +02:00
|
|
|
** Copyright (C) 2019 The Qt Company Ltd.
|
2016-01-15 14:51:16 +01:00
|
|
|
** Contact: https://www.qt.io/licensing/
|
2013-09-11 12:32:20 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** This file is part of the Qt Creator documentation.
|
2013-09-11 12:32:20 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** 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.
|
2013-09-11 12:32:20 +02:00
|
|
|
**
|
2016-01-15 14:51:16 +01:00
|
|
|
** GNU Free Documentation License Usage
|
2013-09-11 12:32:20 +02:00
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
2016-01-15 14:51:16 +01:00
|
|
|
** 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.
|
2013-09-11 12:32:20 +02:00
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
\previouspage creator-developing-generic-linux.html
|
|
|
|
|
\page creator-developing-ios.html
|
2019-10-11 15:02:52 +02:00
|
|
|
\nextpage creator-developing-mcu.html
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
\title Connecting iOS Devices
|
|
|
|
|
|
2017-09-01 09:04:11 +02:00
|
|
|
You can connect iOS devices to your local machine with a USB cable to
|
2017-02-21 14:47:56 +01:00
|
|
|
run applications built for them from \QC.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
2016-08-03 16:46:29 +02:00
|
|
|
To be able to use \QC on \macos, you must install Xcode, and therefore,
|
2013-09-11 12:32:20 +02:00
|
|
|
you already have the tool chain for building applications for iOS. \QC
|
|
|
|
|
automatically detects the tool chain and creates the necessary
|
2017-02-21 14:47:56 +01:00
|
|
|
\l{glossary-buildandrun-kit}{kits} to build applications for and run them on
|
2013-09-11 12:32:20 +02:00
|
|
|
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
|
|
|
|
|
|
2016-08-29 10:45:25 +02:00
|
|
|
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.
|
|
|
|
|
|
2017-09-01 09:04:11 +02:00
|
|
|
The first time you connect the device to your local machine, you are asked to enable
|
2016-08-29 10:45:25 +02:00
|
|
|
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.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
To configure connections between \QC and an iOS device:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
\li Make sure that you have Xcode and Qt for iOS installed.
|
|
|
|
|
|
2017-09-01 09:04:11 +02:00
|
|
|
\li Connect the device to your local machine with a USB cable.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
2016-08-29 10:45:25 +02:00
|
|
|
\li Start Xcode to configure the device.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
2016-08-29 10:45:25 +02:00
|
|
|
For example, in Xcode version 7.3.0, select \uicontrol Window >
|
|
|
|
|
\uicontrol Device > \uicontrol + > \uicontrol {Add Device} to add
|
|
|
|
|
the connected device.
|
2013-10-30 15:30:50 +01:00
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
\li To specify build settings:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
|
|
|
|
\li Open a project for an application you want to develop for the
|
|
|
|
|
device.
|
|
|
|
|
|
2016-10-04 16:53:05 +02:00
|
|
|
\li Select \uicontrol Projects > \uicontrol {Build & Run} to select
|
2017-02-21 14:47:56 +01:00
|
|
|
the kit for building applications for and running them on iOS.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
\image qtcreator-ios-add-kit.png "Build & Run Settings"
|
|
|
|
|
|
2017-05-31 09:28:06 +02:00
|
|
|
\li In \uicontrol {iOS Settings}, select the development team to use
|
|
|
|
|
for signing and provisioning applications. You must configure
|
|
|
|
|
development teams and provisioning profiles in Xcode using an
|
|
|
|
|
Apple developer account.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-build-settings-ios.png "iOS build settings"
|
|
|
|
|
|
2017-09-01 09:04:11 +02:00
|
|
|
\li Select the \uicontrol {Automatically manage signing} check box
|
|
|
|
|
to automatically select the provisioning profile and signing
|
|
|
|
|
certificate on your local machine that matches the entitlements
|
|
|
|
|
and the bundle identifier of the iOS device.
|
|
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
\endlist
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
\li Select \uicontrol Run to specify run settings.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
2014-03-25 16:08:15 +01:00
|
|
|
\note If you cannot deploy applications, because a provisioning profile is
|
2016-08-29 10:45:25 +02:00
|
|
|
missing, check that provisioning profiles are listed in Xcode by selecting
|
2017-09-01 09:04:11 +02:00
|
|
|
\uicontrol Xcode > \uicontrol Preferences > \uicontrol Accounts. For more
|
|
|
|
|
information about how to acquire and install a provisioning profile, see
|
|
|
|
|
Apple documentation.
|
2014-03-25 16:08:15 +01:00
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
\section1 Viewing Device Connection Status
|
|
|
|
|
|
2017-09-01 09:04:11 +02:00
|
|
|
When you connect an iOS device to your local machine with USB, \QC
|
2013-10-30 15:30:50 +01:00
|
|
|
automatically detects the device if you have configured it by using Xcode.
|
2014-12-11 15:43:19 +01:00
|
|
|
To view information about the connected device, select \uicontrol Preferences >
|
|
|
|
|
\uicontrol Devices.
|
2013-10-30 15:30:50 +01:00
|
|
|
|
|
|
|
|
\image qtcreator-ios-device-configurations.png "Devices dialog"
|
|
|
|
|
|
2014-12-11 15:43:19 +01:00
|
|
|
If the current device state is \uicontrol Connected, (the traffic light icon is
|
2013-10-30 15:30:50 +01:00
|
|
|
orange), you need to configure the device using Xcode.
|
|
|
|
|
|
2017-07-13 09:41:41 +02:00
|
|
|
\section1 Specifying Supported iOS Versions
|
|
|
|
|
|
2021-12-06 16:40:20 +01:00
|
|
|
You can build applications for the latest iOS version and deploy them to
|
2017-07-13 09:41:41 +02:00
|
|
|
previous versions. For the most part, this works automatically. However,
|
|
|
|
|
you must take care when you manually set your own target version. If you set
|
|
|
|
|
it to a value higher than what Qt requires and supply your own \c Info.plist
|
|
|
|
|
file, you must add an \c LSMinimumSystemVersion entry to the \c Info.plist
|
2021-12-06 16:40:20 +01:00
|
|
|
that matches the value of \l{CMake: CMAKE_OSX_DEPLOYMENT_TARGET}
|
|
|
|
|
{CMAKE_OSX_DEPLOYMENT_TARGET} (when using CMake),
|
|
|
|
|
\l QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake), or
|
|
|
|
|
\l{https://doc.qt.io/qbs/qml-qbsmodules-cpp.html#minimumIosVersion-prop}
|
|
|
|
|
{cpp.minimumIosVersion} (when using Qbs) because iOS (and the App Store)
|
|
|
|
|
will use the \c LSMinimumSystemVersion value as the authoritative one.
|
2017-07-13 09:41:41 +02:00
|
|
|
|
|
|
|
|
If you specify a deployment target value lower than what Qt requires, your
|
|
|
|
|
application will almost certainly crash somewhere in the Qt libraries when
|
|
|
|
|
run on an older version than Qt supports. Therefore, make sure that the
|
|
|
|
|
actual build system code reflects the minimum iOS version that is actually
|
|
|
|
|
required.
|
|
|
|
|
|
|
|
|
|
For more information, see \l{Expressing Supported iOS Versions}.
|
|
|
|
|
|
2017-07-28 16:34:08 +02:00
|
|
|
\section1 Testing on Simulator
|
2013-10-30 15:30:50 +01:00
|
|
|
|
|
|
|
|
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}
|
2017-07-28 16:34:08 +02:00
|
|
|
{Simulator}, which is installed as part of Xcode. Each Xcode version
|
2014-12-11 11:08:25 +01:00
|
|
|
simulates a predefined set of hardware devices and software versions.
|
|
|
|
|
|
|
|
|
|
You can change the simulated hardware and software version in the run
|
2014-12-11 15:43:19 +01:00
|
|
|
settings for the project. Select \uicontrol Projects > \uicontrol Run, and then select
|
|
|
|
|
the device to simulate in the \uicontrol {Device type} field.
|
2013-10-30 15:30:50 +01:00
|
|
|
|
2017-07-28 16:34:08 +02:00
|
|
|
\image qtcreator-ios-simulator-deploy.png
|
|
|
|
|
|
|
|
|
|
The simulator is started automatically when you run the application.
|
|
|
|
|
To start the simulator manually, select \uicontrol Preferences >
|
|
|
|
|
\uicontrol Devices > \uicontrol iOS > \uicontrol Start.
|
|
|
|
|
|
|
|
|
|
To take screenshots of the simulator, select \uicontrol Preferences >
|
|
|
|
|
\uicontrol Devices > \uicontrol iOS > \uicontrol Screenshot. The screenshots
|
|
|
|
|
are stored in the directory specified in the
|
|
|
|
|
\uicontrol {Screenshot directory} field.
|
|
|
|
|
|
|
|
|
|
\section2 Managing Simulators
|
|
|
|
|
|
|
|
|
|
The available simulators are listed in \uicontrol Preferences >
|
|
|
|
|
\uicontrol Devices > \uicontrol iOS.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-ios-preferences.png
|
|
|
|
|
|
|
|
|
|
To create a new simulator instance:
|
|
|
|
|
|
|
|
|
|
\list
|
|
|
|
|
|
|
|
|
|
\li Select \uicontrol Create.
|
|
|
|
|
|
|
|
|
|
\li In the \uicontrol {Device type} field, select the device type from
|
|
|
|
|
a list of devices supported by the Xcode version set as current on
|
2017-09-01 09:04:11 +02:00
|
|
|
your local machine.
|
2017-07-28 16:34:08 +02:00
|
|
|
|
|
|
|
|
\li In the \uicontrol {OS version} field, select an OS version from a
|
|
|
|
|
list of OS versions supported by the selected device and the current
|
|
|
|
|
Xcode version.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
To rename the selected simulator, select \uicontrol Rename.
|
|
|
|
|
|
|
|
|
|
To reset the contents and settings of the selected simulators, select
|
|
|
|
|
\uicontrol Reset.
|
|
|
|
|
|
|
|
|
|
To delete the selected simulator, select \uicontrol Delete.
|
|
|
|
|
|
|
|
|
|
\section2 Checking Current Xcode Version
|
|
|
|
|
|
|
|
|
|
To check the current Xcode version, enter the following command:
|
2013-10-30 15:30:50 +01:00
|
|
|
|
|
|
|
|
\c {xcode-select --print-path}
|
|
|
|
|
|
|
|
|
|
To change the version, enter the following command:
|
|
|
|
|
|
|
|
|
|
\c {xcode-select --version}
|
|
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
*/
|