After you develop and test your iOS app in Xcode simulator, you also need to deploy your app to real device such as iPhone or iPad device to run and test. Because some bugs only exist on real device, so it is also necessary. This article will tell you how to do it.
1. Run Xcode iOS App in Real iPhone Steps.
- Connect your iPhone to MacOS machine with a USB line.
- Then in Xcode, click Product —> Destination menu item in the top menu bar. Then select your real iPhone device under Device menu.
- Then you can click the Run button ( triangle button) at top to run the app on the target iPhone.
2. Run iOS App In Real iPhone Errors.
But during above process, you may encounter some errors like below.
2.1 Real iPhone iOS Version Not Match Xcode App Project Target iOS Version.
To resolve this error, you should follow below steps to change the Xcode project app iOS deployment target version.
- Click the Xcode project name.
- Select Build Settings tab.
- In the Deployment section, select your iPhone iOS version in the iOS Deployment Target drop down list. Then this error has been resolved.
2.2 Requires A Developer Team.
Although apple do not require developer to cost money to deploy and test iOS app in real device since Xcode 7.0, but to run and test app in real device, you still need a free developer account. Other wise you may see below errors in the Xcode project Signing section.
Singing for ” iOS App Name ” requris a development team.
Follow below steps to resolve this issue.
- Click the Add Account… button after the Team label. Then input an exist or register a new apple account id.
- After successfully login with the apple account, you can see the account in the accounts list left panel. Then close the dialog.
- Now you can select the apple account in the Signing section Team drop down list.
2.3 This App Need Trust Settings In Real iPhone.
Before you can run the Xcode app project in real iPhone device, you also need to trust the app in your iPhone, other wise you may encounter could not launch errors.
Steps To Trust The Xcode App In iPhone.
- Click General —> Settings —> Device Management menu item in iPhone device. The Device Management menu item only appear when you run the Xcode app on the iPhone.
- Click the app in the DEVELOPER APP section.
- Click the Trust button in the next screen. Then you can run the Xcode project app in your iPhone device. If you want to remove the trust, just need to click the Delete App button to remove it.