Using an iOS 13 device for development

Although you'll be able to go through most of the exercises in this book using the Simulator, it is recommended to build and test your apps on an actual iOS device, as the Simulator will not be able to simulate some hardware components and software APIs.

For a comprehensive look at all the differences between the 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 or a paid Apple Developer account to build and run your app on your device. You'll use the same Apple ID that you used in the App Store for now:

  1. Use the USB cable to connect the iOS device to your Mac.
  2. In the Scheme menu, choose your device (iPhone in this case):

  1. Wait for Xcode to finish indexing and processing, which will take a while. Once complete, Ready will be displayed in the status window.
  2. Run the project by hitting the Play button (or use command + R). You will get the following error: Signing for "Exploring Xcode" requires a development team:

This is because a digital certificate is required to run the app on an iOS 13 device, and you need to add an Apple ID or a Developer account to Xcode so the digital certificate can be generated. 

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.
  1. Click the Add Account... button:

  1. The Xcode Preferences window appears with the Accounts pane selected. Enter your Apple ID and click Next. Note that you can create a different Apple ID if you wish using the Create Apple ID button:

  1. Enter your password when prompted. After a few minutes, the Accounts pane will display your account settings:

  1. Close the Preferences window when you're done by clicking the red button in the top-left corner.
  1. In Xcode's editing area, Click Signing & Capabilities. Make sure Automatically manage signing is ticked and Personal Team is selected from the Team pop-up menu:

  1. If you still see errors in this screen, try changing your Bundle Identifier by typing some random characters into it, for example, com.12345myname.Exploring-Xcode.
  2. Everything should work now when you build and run, and your app will be installed on your iOS device. However, it will not launch and you will see the following message:

This means you need to trust the certificate that has been installed on your device.

You can also access Xcode preferences by choosing Preferences in the Xcode menu.

In the next section, we will see how to do that.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.40.207