All iOS, tvOS, and watchOS apps must be code signed using a provisioning profile to launch on a device. macOS apps that use certain app services must be signed to launch on your Mac too.
If you use automatic signing (recommended), Xcode creates the necessary signing assets for you in your developer account. If the team belongs to a developer program, you’ll need to explicitly register the device before you run the app. For macOS apps, you register the Mac running Xcode.
Before you begin, add your Apple ID account and assign the target to a team.
For iOS, tvOS, and watchOS apps, connect the device to your Mac. For watchOS apps that are dependent on an iOS app, connect an iPhone that is paired with an Apple Watch.
You may need to wait for Xcode to enable the device before it appears in the scheme menu for the next step. For iOS and watchOS apps, unlock the device screen and trust the computer.
From the scheme pop-up menu in the toolbar, choose a scheme and the device under Device.
For watchOS apps, choose the WatchKit App target as the scheme and the Apple Watch as the run destination. For watchOS apps that are dependent on an iOS app, both the Apple Watch and iPhone names appear in the menu.
For macOS apps (including a Mac version of an iPad app), choose My Mac as the run destination. For the iPad version, choose an iPad device under Device.
If the device appears under Unavailable Device in the scheme menu, hover the mouse over the device, read the reason, and fix the problem.
For example, if the operating system version is lower than the deployment target, upgrade the operating system version on the device or change the deployment target in your project.
In the project editor, click Signing & Capabilities, reveal the Signing settings, then click Register Device(s) under Status.
If you previously registered the device, the Register Device button doesn’t appear.
Note: You’re allowed to register a fixed number of devices per product family per year, and disabling a device in your developer account won’t decrease the count of registered devices.
Alternatively, register the device when the dialog appears later.
In the toolbar, click the Run button.
If the product builds successfully, Xcode installs and launches the app on the device.
You can also check the status of a connected device in the Devices and Simulators window.