Introduction: Here is a record of a real machine debugging problem encountered during the development process:Unable to prepare xxx iPhone for development
report an error
When compiling and running the real machine, it will prompt the following at the end:
Unable to prepare xxx iPhone for development
Please check the connection to the device, and review all errors in the Devices and Simulators window.
复制代码
By opening Window - Devices and Simulators
, you can see:
Failed to prepare device for development.
if youare certain thax xcode supports development on this device, try disconnecting and reconnecting the device.
复制代码
problem solved
There are prompts to add compatible compatible files:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport
复制代码
I just want to say that this is a must. If the Xcode version is not compatible with the mobile version, it will definitely not work. This is just a necessary condition.
Then, the old routine is still implemented. Once there is an abnormal real machine debugging problem, there are four steps:
Command + Shift + K
Clear the Xcode cache, compile and run;完全关闭退出 Xcode 重启
, compile and run again;手机重启
, compile and run again;电脑重启
, compile and run again.
Basically, in the case of a sudden problem that was running well before, after these four steps, 90% of the problems can be solved.
I solved it here in the third step.
Summarize
Record it here for daily study.
Reference link
Copyright Notice
Original author : Alfalfa Guixian (Alfalfa, jijiucheng)
Original link : GitHub.io - Alfalfa Guixian - [iOS] Real machine debugging report Unable to prepare xxx iPhone for development error
Release date : 2022/05/09 18:00:00
Update date : 2022/05/09 18:00:00
GitHub:GitHub - jijiucheng
Personal blog : GitHub.io - Alfalfa ghost
Small Column : Small Column - Alfalfa Ghost
Nuggets : Nuggets - Alfalfa Ghosts
Weibo : Weibo - Alfalfa Ghost Fairy
Public Account : WeChat - Alfalfa Station
Mini Program : WeChat - Alfalfa Station