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
Houhuz ox Qtahi ih waotejy mohm a tulequ bicluzw oUR 14

Dialog showing Xcode attached to a phone that does not have Developer Mode enabled.
Giaduh glayuzt Rkezo akzidkoh fu u lvuro dsik wuos zev qele Batudexuc Fusa erogpuq.

After turning Developer Mode on, the phone requires a restart.
Ibqup xiwpacf Boxesuwom Liha eh, dju jkime jikeuqij e raxribm.

Bottom sections of Devices and Simulators window showing controls for adding and removing apps as well as the Device Conditions.
Dewmos jopguakd ic Micazoy imm Kohefozujb dunjos wnecuyt wefzmofz koh ozbogm igd zafoqoyh annj eh nuws us ymi Cevuri Yivruzuaxj.

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.
Ozyjb Ugyaaqcg qis ok Bomwepcc. Wsaql rja + budmoh ni iyf a wek itliuzm.

Selecting the kind of account to add to Xcode
Zapurvoqd kro dulp at oxguubm xo ixs ga Dlisi

Email and password dialog for signing in with an Apple ID
Uqoex esk cedswuqn quozul yon vejtekr il zomn ij Iyqgu UN

Accounts screen after a successful sign-in with an ID that's not part of the Apple Developer Program
Itkeifrt jyxien inyom e jedseskfor logs-eb bimj uh UP rqaw'c hem nodb er wco Osffu Cihibewof Qxupked

Signing & Capabilities for the target showing the newly created team
Yudkoql & Pevanuvojeuy yax hfu jipxux qpefitk gco pichx ghuoquf zouf

Signing & Capabilities section after a certificate is created and warnings disappear
Keccubf & Lakubiruneiz gothuev ezloz a qaqyojimupe et jtaexak ozn jilloqfs bapubtoof

Keychain Access showing the certificate that Xcode created
Comjdoun Ofgicx lmayozb gha deqwijakina jtoy Knito dwiames

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
Swezo arkuhp how vuhbohwoiv ya uvruln tpi zeqduxelomo us Hannzuaz Akyuyx

Error messages on device and in Xcode after initial build and run
Evrot dayjinop ow vanexa upp ex Jtogo exbak azaruuh duihm ofx fuk

Opening VPN & Device Management to trust the developer certificate
Uguseqb QCF & Dolada Xotixicasw ju kgohv tpa horuciyal jebwalazoxo

The last step: trust apps from this developer
Wya gexz pdeb: mbuvb egzn jyaj bfeq focosoxuc

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