Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 12: Failed to start remote service "com.apple.debugserver" on iOS device

I updated my Xcode to Version 12.4 (12D4e) and after that I am unable to run my app on my device iPhone X iOS 14.4.2.

Its alway show this Error

enter image description here

When I check my device connected status, Its show as connected

enter image description here

Action I applied

  1. Clear DerivedData folder.

  2. Unpair device and connected again.

  3. Drank 20+ coffees.

like image 968
iDeveloper Avatar asked Apr 20 '21 05:04

iDeveloper


3 Answers

I was able to fix the Xcode 12 app install/deployment issue described above:

Failed to start remote service "com.apple.debugserver" on device.

Domain: com.apple.dtdevicekit  
Code: 811
Recovery Suggestion: Please check your connection to your device. 
User Info: {  
  DVTRadarComponentKey = 261622;  
}
...

by doing the following steps:

  1. Quiting Xcode.
  2. Deleting Xcode cache directory (ie, rm -rf ~/Library/Caches/com.apple.dt.Xcode).
  3. Rebooting the offending iOS device.
  4. Connecting the iOS device to Xcode by cable (instead of wireless network connection).
  5. Starting Xcode again.

By the way, I've a setup very close to yours:

  • Xcode 12.5 (build 12E262) and
  • iOS 14.5.1 (on a iPhone Xʀ device)
like image 178
Paulo Mattos Avatar answered Nov 09 '22 01:11

Paulo Mattos


1st solution

I fixed this by:

  1. Closing Xcode

  2. Deleting the current iOS version in my folder that's related to my device.

    ~/Library/Developer/Xcode/iOS DeviceSupport
    
  3. Restarting Xcode. Wait a little bit for it to refresh and copy cache files in my case then Run.

Based on Can I delete data from the iOS DeviceSupport directory? it's ok to delete the iOS DeviceSupport folder.

I noticed when I did it and reconnected my device it re-downloaded the iOS device Support files. If the support files don't download and the cache files are not copying, try restarting your computer as well.

I started also getting this error:

Errors were encountered while preparing your device for development.
Please check the Devices and Simulators Window.

Restart your phone and reconnect it to the compter if this happens. Then you should get a message in Xcode saying:

Preparing your phone for development.

2nd solution

  1. Unpair the device in Xcode.
  2. Clean the project.
  3. Unplug and then restart iPhone.
  4. Restart Xcode.

3rd solution

If none of the above worked, I was able to run the program by re-enabling Connect via Network.

After doing this now I can run project via USB.

4th solution

I submitted this bug to Apple. Apple also suggests this can be caused by faulty data cords. Maybe try another cord as well.

like image 12
uplearned.com Avatar answered Nov 09 '22 03:11

uplearned.com


Unplug the iPhone, Turn it off and again turn it on and reconnect. It worked for me. Sometimes iPhone Debug connection network server clogs up. When you restart iPhone it reinitiate the connection.

like image 8
rajivdulash Avatar answered Nov 09 '22 02:11

rajivdulash