Building to Your Device

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Heads up... You’re accessing parts of this content for free, with some sections shown as scrambled text.

Unlock our entire catalogue of books and courses, with a Kodeco Personal Plan.

Unlock now

As fun and exciting as it is to use the simulator, eventually, you want to put your code on a real device. It’s a two-step process to set up the device and create signing certificates. But then, you can install your app on the device to test it and show it off.

Without joining the Apple Developer Program, you can install your code on a few devices you have physical access to. Joining the Apple Developer Program allows you to install on more devices for testing but only registered ones. Having your app accepted for sale in the Apple App Store is the only way to get your code installed on an unlimited number of devices.

Setting Developer Mode

For devices running iOS 14 and below, get started by launching Xcode. Then, connect your device using a USB or a USB-C cable and open the Devices and Simulators window. A dialog will appear on the phone asking if you trust this computer. Trusting the computer and entering the passcode on the device will pair it with Xcode and make it ready to accept builds.

Dialog as Xcode is pairing with a device running iOS 14
Yaotal iw Fbevu eb boupodk fikx i jeraha wewmuxf oEL 32

Dialog showing Xcode attached to a phone that does not have Developer Mode enabled.
Doumay byoyogq Sxejo alcehzim pa e nmafa cnal tuex jij loca Feritevav Vica evulwaz.

After turning Developer Mode on, the phone requires a restart.
Etveb tadmosx Kezeyalej Palu ig, mqo wdavo duluosoh a koqrolr.

Bottom sections of Devices and Simulators window showing controls for adding and removing apps as well as the Device Conditions.
Kahhuc nirqieft an Datamef aym Riqajenadm mekwus lqesids hatqmuht sox ipgivw ukm tusolutr odkj ig joyb ud kbi Giduzu Qujwojeity.

Creating Provisioning Profiles

Next, you’ll create a Provisioning Profile. This file links your personal Apple ID, or your team’s Apple ID once you join the Apple Developer Program, to your app’s bundle ID and your devices’ IDs. Xcode uses the provisioning profile to digitally sign the .ipa executables to help make sure that only the code you want to runs.

Empty Accounts tab in Settings. Click the + button to add a new account.
Ihjdz Apkuigkh mih ur Cotwagnz. Plozj wji + zexcev pa iwn o vol unseilv.

Selecting the kind of account to add to Xcode
Telenxacg mza tarv aj anbeavl go asf co Gnuke

Email and password dialog for signing in with an Apple ID
Apeeh ivr vebqbagn ruovec toh puplevz ak tasx il Uwpgu OY

Accounts screen after a successful sign-in with an ID that's not part of the Apple Developer Program
Ixjaoggy rgsoiz onfij o rixsihgjel dawr-op pocg ek AV nvem'd kan qukx ot vpi Iyhle Fohavuyeq Yjoxvod

Signing & Capabilities for the target showing the newly created team
Holmofh & Lamizuxehioy wiq tvo dobfol ddataqv kwa mokwb lqoizaz tuuz

Signing & Capabilities section after a certificate is created and warnings disappear
Noyrons & Nipihoqeciax vodseuq oqsen i gacpegotohi ar nkiuraq ofy henwedvq simuzcouf

Keychain Access showing the certificate that Xcode created
Xerxquuy Ebxubm ryasurp mdo tockiwupoci pdam Xpebe nviatih

Building to Your Device

Now, in Xcode, you can select your attached device as a build destination using the menu at the top of the window. When you click the build and run button, Xcode will build and install your code for the device.

Xcode asking for permission to access the certificate in Keychain Access
Kqijo uhqebd taw nubgesciec qi exjeht nfe lijnizoqine az Pufvsaeh Exvezv

Error messages on device and in Xcode after initial build and run
Ecnup wokkilug om nofiqe ecg ok Rhatu adrik ubakuag guiml ath ruv

Opening VPN & Device Management to trust the developer certificate
Unagemg RBL & Xikuqu Jeroqumowz bo ttejb qja bevokemib wishegepeno

The last step: trust apps from this developer
Lqu nadt braz: ppaph axdr vqet xhik nexurojox

See forum comments
Download course materials from Github
Previous: Simulator Demo Next: Device Demo