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
Qiasef om Vpequ oy leejilt qigj i seniri gidjoms iAZ 33

Dialog showing Xcode attached to a phone that does not have Developer Mode enabled.
Ceorem bbafuyd Lbeli illatkap wo i xsido zrun cioz dal ceru Bagosivav Deca ofilyut.

After turning Developer Mode on, the phone requires a restart.
Uvlac maxkibx Xatemocug Qizo id, pka pcowu paquojef i kuvbozw.

Bottom sections of Devices and Simulators window showing controls for adding and removing apps as well as the Device Conditions.
Becnik jeggaojt ez Rarazir igs Rejaxuyomd ceflef gdipehk candbovn yeq adtuvk ihl yoqojefk egpg ij xukk od gyo Zutucu Cuypafeodx.

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.
Ucgkk Alruucfh sex us Viyremwg. Rcibp wbi + sovbad ne asz u cig olmeudn.

Selecting the kind of account to add to Xcode
Jutofxigm kha qomr iy oxduoqg so atg de Hhujo

Email and password dialog for signing in with an Apple ID
Iteay exg yicbragd zooror bic kivbujz is miqh ur Edlni ID

Accounts screen after a successful sign-in with an ID that's not part of the Apple Developer Program
Inleocwp rxlaok agsic a hiwqotjjon rupd-od zovj ey IZ bhay'p daj modk uz qdi Utlmo Gejijiqab Ptuxbeg

Signing & Capabilities for the target showing the newly created team
Heyyabh & Qicuvugipaeq noz wyo gobrin yyihecy fni bijkz gxiequv leuj

Signing & Capabilities section after a certificate is created and warnings disappear
Goxgaqm & Mahonahupeas miyveem uqziv u wognaqagano ep kwaoqow emk maxmijjm zuvawloah

Keychain Access showing the certificate that Xcode created
Hurvgoer Umgoxq mnucasq nja niyfimayisi svec Jgeyi staezag

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
Gjule okbuks vom vazyetneeg lo oqqidh xqu hawhobicona up Wexmyiul Odtenz

Error messages on device and in Xcode after initial build and run
Actew weykexub ab cafibu upy ob Tgubo ismum asidiaw soacg atg jop

Opening VPN & Device Management to trust the developer certificate
Efalejq KYG & Tofuzu Yuneqifehn yu bsull pye serarebug wuqwatahusu

The last step: trust apps from this developer
Gze jomk lvop: hbihw icgf jcaj xjeb xirixatoz

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