preface

Every now and then, during RN development, project testing might reveal a compatibility issue with the iPhone version. This problem is really jEDt (especially for those of us who don’t know much about native development but are doing it (RN)). It may take a lot of time for the project to run and the problem to reappear. The key is that if there is a problem in the process, you often cannot understand the error message given, which is πŸ₯š. No way, only continuous gu 🐢 (but habit is good). Here is not how to go to the debugger; But how to install the project APP to the real machine for real machine debugging. If there is no real device with the corresponding IOS version, you can first try to test the Simulator with the corresponding version in Xcode. For details, you can check the Xcode under MAC to modify the Simulator version

Add account

  • Device to connect: Data line will be usedmacEven oniPhone ζˆ– iPad
  • Open the project:XcodeOpen the project (make sureBundle IDThe only); If you cannot open the project file, try theFinderI’m gonna hit File open
  • Add account: choose thePodsFor another file, selectTARGETS - Signing & CapabilitiesWithin theTeamAdd accountAdd an Account...

  • Type in yoursApple IDAnd passwordSign in

  • We can also clickXcodeUpper menu barXcode - PreferenceAfter choosingAccountsGo to the account screen by clicking on the lower right corner+Add an account and select the account type

  • Apple IDAfter logging in to add,AccountsThe account information is displayed. Such as:Team ε’Œ RoleAnd so on. (Apple ids that are not registered as paid developer accounts are shown as User)

Note ⚠️ : No Teams is still displayed under Accounts after logging in to Apple ID. Go to the Apple Developer website, click on the Account in the upper right corner, log in with your Apple ID, and wait a day or two

Select account

  • Go back toXcodeHome page, inTeamSelect the added account there

The account and device version match

  • iPhone ε’Œ XcodeThe account ofApple IDNeed to be consistent, useIOSVersions should also match

Note: iPhone and Xcode version and account do not match may not be real machine debugging

  1. iPhone ζ―” XcodeThe system version is low, if you do not want to upgrade or cannot upgrade can be inXcodeHome page selection andiPhoneThe matchingIOSVersion number is ok
  2. iPhone ζ―” XcodeIf the system version is higher, you need to download a version that supports a later versionXcode. (The latest version may be unstable and cause other problems)

  • Select device (real/simulator)

Note: Since my iPhone OS version is 15.0.2, Xcode version supports the highest OS version 14, so nosupported OS version will be displayed. Version matching does not have this problem (here is not another redundant!!)

  • After selecting the connected real or emulator device, click in the upper left cornerbuildButton to build the project

Note: Pay attention to the information on the phone during the process of installing the APP package to the phone. There may be a device trust prompt and other information to confirm

Wireless real machine debugging

  • Make sure thatiPhone ε’Œ MacBe in the same placeWiFiNext, clickXcodeUpper menu barWindow - Devices and Simulators

  • inDevicesColumn, select theConnect via networkWait a minuteLeftiPhone 13There will be 🌍 onOK δΊ†

Note: If the versions of iPhone and Xcode are inconsistent, the following warning and error messages will appear. Under normal circumstances, select Connect via network as described above and 🌍 will appear.

Reference: iOS12-Xcode10-App real machine debugging and some pits