2013-09-11 12:32:20 +02:00
|
|
|
/****************************************************************************
|
|
|
|
|
**
|
2014-01-07 13:27:11 +01:00
|
|
|
** Copyright (c) 2014 Digia Plc and/or its subsidiary(-ies).
|
2013-09-11 12:32:20 +02:00
|
|
|
** Contact: http://www.qt-project.org/legal
|
|
|
|
|
**
|
|
|
|
|
** This file is part of Qt Creator
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
** GNU Free Documentation License
|
|
|
|
|
**
|
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU Free
|
|
|
|
|
** Documentation License version 1.3 as published by the Free Software
|
|
|
|
|
** Foundation and appearing in the file included in the packaging of this
|
|
|
|
|
** file.
|
|
|
|
|
**
|
|
|
|
|
**
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
|
2014-03-17 12:18:12 +01:00
|
|
|
\contentspage {Qt Creator Manual}
|
2013-09-11 12:32:20 +02:00
|
|
|
\previouspage creator-developing-generic-linux.html
|
|
|
|
|
\page creator-developing-ios.html
|
2013-10-09 12:22:20 +02:00
|
|
|
\nextpage creator-developing-qnx.html
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
\title Connecting iOS Devices
|
|
|
|
|
|
|
|
|
|
You can connect iOS devices to a Mac computer with a USB cable to
|
|
|
|
|
build and run applications on them from \QC.
|
|
|
|
|
|
2014-05-02 12:44:45 +02:00
|
|
|
To be able to use \QC on OS X, 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
|
|
|
|
|
\l{glossary-buildandrun-kit}{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.
|
|
|
|
|
|
|
|
|
|
\section1 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 \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.
|
|
|
|
|
|
|
|
|
|
\li Connect the device to the Mac computer with a USB cable.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
\li Start Xcode to configure the device:
|
|
|
|
|
|
|
|
|
|
\list 1
|
|
|
|
|
|
2014-03-25 11:31:16 +01:00
|
|
|
\li Select \gui Window > \gui Organizer.
|
2013-09-11 12:32:20 +02:00
|
|
|
|
|
|
|
|
\li Select the \gui + button to add the connected device.
|
|
|
|
|
|
|
|
|
|
\li Select the device you want to add in the list of devices.
|
|
|
|
|
|
|
|
|
|
\li If you do not have an Apple developer account, you can now
|
|
|
|
|
create one, for a charge.
|
|
|
|
|
|
|
|
|
|
\li When your account is ready, you can add the device. Your
|
|
|
|
|
Apple developer certificate is copied to the device.
|
|
|
|
|
|
|
|
|
|
\li The first time you connect the device, you are asked to
|
|
|
|
|
enable developer mode on the device.
|
|
|
|
|
|
|
|
|
|
\endlist
|
|
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
The connections between \QC and an iOS device are protected by using an
|
|
|
|
|
iOS Developer Program certificate that you receive from Apple for a
|
|
|
|
|
charge when you
|
|
|
|
|
\l{http://developer.apple.com/library/ios/documentation/IDEs/Conceptual/AppDistributionGuide/EnrollingADP/EnrollingADP.html}
|
|
|
|
|
{enroll in the iOS Developer Program}. The certificate is copied to the
|
|
|
|
|
device when you configure the device.
|
|
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
The next time you connect the device to the Mac computer, \QC
|
|
|
|
|
detects it automatically. To disable automatic connections to a
|
|
|
|
|
device that you do not use for development, select \gui Preferences >
|
|
|
|
|
\gui iOS, and deselect the
|
|
|
|
|
\gui {Ask about devices not in developer mode} check box.
|
|
|
|
|
|
2013-11-06 12:09:43 +01:00
|
|
|
\note If \QC does not detect the devices, the iOS plugin might not be
|
|
|
|
|
enabled. Select \gui {Qt Creator} > \gui {About Plugins} >
|
|
|
|
|
\gui {Device Support} > \gui iOS and restart \QC.
|
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.
|
|
|
|
|
|
|
|
|
|
\li Select \gui Projects > \gui {Build & Run} > \gui {Add Kit} to
|
|
|
|
|
add a kit for building and running applications on iOS.
|
|
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
\image qtcreator-ios-add-kit.png "Build & Run Settings"
|
|
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
\endlist
|
|
|
|
|
|
|
|
|
|
\li Select \gui Run to specify run settings.
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
missing, try refreshing the list of provisioning profiles in Xcode. Select
|
|
|
|
|
\gui Xcode > \gui Preferences > \gui Accounts > \gui {View Details}, and
|
|
|
|
|
then select the \gui Refresh button.
|
|
|
|
|
|
2013-10-30 15:30:50 +01:00
|
|
|
\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.
|
|
|
|
|
To view information about the connected device, select \gui Preferences >
|
|
|
|
|
\gui Devices.
|
|
|
|
|
|
|
|
|
|
\image qtcreator-ios-device-configurations.png "Devices dialog"
|
|
|
|
|
|
|
|
|
|
If the current device state is \gui Connected, (the traffic light icon is
|
|
|
|
|
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
|
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
|
|
|
|
|
settings for the project. Select \gui Projects > \gui Run, and then select
|
|
|
|
|
the device to simulate in the \gui {Device type} field.
|
2013-10-30 15:30:50 +01:00
|
|
|
|
|
|
|
|
\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}
|
|
|
|
|
|
2013-09-11 12:32:20 +02:00
|
|
|
*/
|