Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone constantly disconnecting while working in Xcode

I've been developing an app for a while and I haven't had any problems running the app on the device.. now a few days ago, whenever I connect the iPhone, it plays its little "ka-chink" sound and shows up in Xcode, but after a few seconds it disconnects and reconnects with another "la-chink" and keeps doing this until I want to throw it out of the window.

Of course, it's not possible to debug on the device with the constant disconnections, so I just:

  • connect the device
  • run the app on the device
  • app crashes
  • I remove the cable
  • restart the app and it runs fine

I've tried various thing to get the phone to work properly again but to no avail so far.. anybody experienced this? any solutions?

Update: cable and connector fine, no hardware trouble.

like image 593
Frank R. Avatar asked Aug 14 '14 14:08

Frank R.


People also ask

How do I connect my iPhone to my Mac for development?

Connect to the Mac from Visual Studio 2022Open the Pair to Mac dialog with the Pair to Mac button iOS toolbar: Alternatively, select Tools > iOS > Pair to Mac. The Pair to Mac dialog displays a list of all previously connected and currently available Mac build hosts: Select a Mac in the list and select Connect.

How do I force quit USBD on Mac?

A solution to the issue of iPhone rapidly disconnecting from a Mac that has worked for many is stopping the usbd process. To do that, open the Terminal app from Spotlight (Command+ Space) and enter the command sudo killall -STOP -c usbd.


2 Answers

I think this is not the problem with the device/Mac port/USB cable.

This seems to be an issue with usbd in Mac OS. The following can solve the issues:

Open Activity Monitor -> View -> All Processes -> Search for usbd -> Double click -> Quit -> Force Quit

Using terminal:

sudo killall -STOP -c usbd will pause the issue related process

If you want to resume the process for any reason use the following command

sudo killall -CONT usbd

This solution is working in MacOS Catalina as well.

like image 51
Durga Vundavalli Avatar answered Sep 22 '22 21:09

Durga Vundavalli


In the end removing expired certificates (current ones were already installed) solved the problem.

like image 44
Frank R. Avatar answered Sep 24 '22 21:09

Frank R.