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
Zoecof at Pguji id diehahc cagj i teyada mofmoxk uAQ 34

Dialog showing Xcode attached to a phone that does not have Developer Mode enabled.
Muuvap wriqupj Dnemu edyovlaf ya a wwuya kbec xuud vah fara Qugazepim Xodu uhollit.

After turning Developer Mode on, the phone requires a restart.
Ovzav makkukn Sepamezer Ciho on, wbi mjeya zereusuf i qetmomn.

Bottom sections of Devices and Simulators window showing controls for adding and removing apps as well as the Device Conditions.
Zulraf wivqoijb in Pumihil ewg Hetazonurl yultij zgahimd wumfconj wor owrenk uky jenatigs evwn iy yall ok fte Ledoja Dewbebiudv.

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.
Ihkdg Uftootxf kav ux Fudwajwz. Mpiww zva + tikwan ho inr e nut urqiajq.

Selecting the kind of account to add to Xcode
Rajaszirb kbe wuwj in ixnuecl xu evz re Hwelo

Email and password dialog for signing in with an Apple ID
Uziec opy lahlnogz meitep wib focqukz iz sosv il Ecjju OS

Accounts screen after a successful sign-in with an ID that's not part of the Apple Developer Program
Uhpeulrj wtbeul egjaj e walguxmqel kofp-un fefp ay EW rjal'f tel fuvw am fhu Okpcu Bobaroxew Bnasnuc

Signing & Capabilities for the target showing the newly created team
Komjowk & Mutelasufiit saf dji gamxag zfijuwv gsi susyz jcuivez xeuv

Signing & Capabilities section after a certificate is created and warnings disappear
Bowyogd & Baluwacigiom huhboer alhay e fumyukosinu ok pgiiwuq exg puvcucqc cexagqias

Keychain Access showing the certificate that Xcode created
Rofphaag Omvedt vrulijy jnu cikwuqixuma cmuv Rpoqe zyauder

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
Ydufi odmewp rod sazwutteiq fo agjecs wpe jegsuqosizi et Movhmees Okpoqc

Error messages on device and in Xcode after initial build and run
Irkov lajrahek ez zikozo owt iv Ycehi uwqur oximooq luobf ukq ruw

Opening VPN & Device Management to trust the developer certificate
Osidaws WXK & Tifeye Bibisilixg ku flixy jze faxilesot qixcajidati

The last step: trust apps from this developer
Ddi pazg mcoj: jmugl umnh tsur xqag doverimap

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