-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

iOS 17 Programming for Beginners
By :

Although you’ll be able to go through most of the exercises in this book using Simulator, it is recommended to build and test your apps on an actual iOS device, as Simulator will not be able to simulate some hardware components and software APIs.
For a comprehensive look at all the differences between Simulator and an actual device, see this link: https://help.apple.com/simulator/mac/current/#/devb0244142d.
In addition to your device, you’ll need an Apple ID (used to automatically create a free Apple developer account) or a paid Apple developer account to build and run your app on your device. You can use the same Apple ID that you used to download Xcode from the App Store. To run your app on an iOS device, follow these steps:
You can view connected devices by choosing Window | Devices and Simulators in the Xcode menu bar.
Figure 1.19: Xcode Destination menu showing iPhone with Developer Mode disabled
Developer Mode was introduced by Apple during their World Wide Developer Conference in 2022 (WWDC 2022), and is required to install, run, and debug your apps on devices running iOS 16 or greater.
To watch a WWDC 2022 video on Developer Mode, click this link: https://developer.apple.com/videos/play/wwdc2022/110344/.
Figure 1.20: Alert showing Developer Mode is not turned on
Figure 1.21: Developer Mode switch
Figure 1.22: Xcode Destination menu with an actual iOS device selected
Figure 1.23: Xcode Signing & Capabilities panel
This is because a digital certificate is required to run the app on an iOS device, and you need to add a free or paid Apple Developer account to Xcode so the digital certificate can be generated.
Using an Apple ID to create a free developer account will allow you to test your app on an iOS device, but it will only be valid for 7 days. Also, you will need a paid Apple Developer account to distribute apps on the App Store. You’ll learn more about this in Chapter 27, Testing and Submitting Your App to the App Store.
Certificates ensure that the only apps that run on your device are the ones you authorize. This helps to protect against malware. You can also learn more about them at this link: https://help.apple.com/xcode/mac/current/#/dev60b6fbbc7.
Figure 1.24: Xcode Signing & Capabilities pane with Add Account… button selected
Figure 1.25: Apple ID creation dialog box
Note that you can create a different Apple ID if you wish using the Create Apple ID button.
You can also access the Xcode settings by choosing Settings in the Xcode menu.
Figure 1.26: Accounts pane in Xcode preferences
Figure 1.27: Xcode Signing & Capabilities pane with account set
com.myname4352.JRNL
.Figure 1.28: Could not launch “JRNL” dialog box
A Developer App certificate is a special file that gets installed on your iOS device along with your app. Before your app can run, you need to trust it. Follow these steps:
Figure 1.29: VPN & Device Management setting in iOS Settings
Figure 1.30: Apple Development section in Device Management settings
Figure 1.31: Trust button
Figure 1.32: Trust dialog box
You should see the following text, which shows the app is now trusted:
Figure 1.33: Apple Development section with trusted certificate
Congratulations! You have successfully run your app on an actual iOS device!