19
votes

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.

7
Is the cable broken ? Try a different one.CW0007007
is the port connector full of fluff/dust? this causes the same thing. Otherwise broken cabler as CW0007007 says.Cocoadelica
It's definitely not a hardware fault. The same cable with the same device work fine on my Mac Pro 2009. Same Xcode version and same dev account (sync-ed).Frank R.
@Frank R., you know, the cable has two ends.A-Live
Correct, everything has an end except a cable which has two.Frank R.

7 Answers

41
votes

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.

5
votes

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

4
votes

The only thing that worked for me (tried many things) was to reset Location and Privacy settings on the iPhone: Settings -> General -> Reset -> Reset Location & Privacy

3
votes

If the problem appeared after Big Sur update, don't worry! This issue has occurred in the past, after major macOS updates, or when users attempt to connect an iPhone for the first time to a new Mac computer. Fortunately, there is a permanent working fix that you can apply using a special command in the Terminal app.

  1. Connect your device

  2. Open terminal

  3. Copy/paste the following command in the Terminal window:

    sudo killall -STOP -c usbd

Thats all! Hope it will help!

0
votes

Try to remove and reactivate your phone from the devUsage in the organizer

0
votes

Note: this may not be a permanent fix. Starting having the error again after 8 hours of no problems.

I just had this problem (devices would connect, then randomly disconnect any time while using Xcode, or not even doing anything, sometimes they would reconnect but after a while I had to completely restart the computer). I fixed it by essentially resetting the "trust this computer" for all of the devices registered to my Mac. I am unsure how I may have gotten my computer to this state; I did change the "name" of my computer in Terminal and that may have done it.

Thanks to this site for pointing me in the right direction: http://andyaffleck.com/2014/11/07/fixing-trust-this-computer-problem/

In /var/db/lockdown there are plist files. I couldn't get access into the folder from the Finder, but using sudo in terminal let me list the files, and I could delete them with sudo rm, one at a time. Somehow the plist files were corrupt or incorrect.

Then after a restart, when I plugged in my phones again, the trust? dialog showed up on the phone, I accepted, and now I have not had a disconnection.

0
votes

Changing the port that connected to cable is worked for me.