26

I know there's 2-3 questions in this community relating to connection issues between iPhones and Macs via a USB connection, and I know a temporary solution to fix it. But I would like to know what exactly does the usbd process do and why is it causing connection issues between some iPhones and some Macs?

Update 12 June 2023:

Please see @Wolf82's detailed answer that they have posted here: iPhone keeps disconnecting and reconnecting to MacBook via USB

TL;DR summary from Wolf82:

The issue of reconnecting iPhones on Macbook/Pro seams to be repeatably caused by the USB sockets in the MacBook and/or the USB connectors on the used lightning cable. Contact resistance of the connector prongs makes the iPhone disconnect and reconnect in high power charging mode.

A solution might be to clean or bend the connectors contacts within the USB socket. For me cleaning solved the issue on one port repeatably! A deeper cleaning or reworking the sockets might fix it permanently.

Thank you @Wolf82.

Here is the original issue below.

The issue

The issue is that some Macs and iPhones don't have a stable connection when connected via the Apple USB Lighting cable. The iPhone often attempts to reconnect very quickly, sometimes reconnecting 2-3 times per a second and continues to do this in an endless loop. Sometimes it will stop if you wiggle the USB Lighting cable, insert it into another USB port or pause the particular Mac process usbd in Terminal.

For me, the issue appears to be more prevalent with the left USB port on my MacBook Pro (but does happen with the right USB port occasionally). Additionally, it is much more likely to happen when the iPhone is on a low charge (i.e. 0-30%), but is known to happen on higher charges occasionally like 70-80%.

Strangely, this doesn't affect every iPhone connecting with my Apple USB Lighting cable or with my iPhone connecting to other Macs (on different OS versions) using the same cable. So I'm quite puzzled why this is happening?

Temporary solution

A temporary solution answered in previous questions is to run a sudo command in Terminal to stop the usbd process from running on your Mac. The command is sudo killall -STOP -c usbd, which pauses the process until you either reboot your Mac or enter the command sudo killall -CONT -c usbd to restart the process. Based on comments to this temporary solution, it appears to fix the connection issue for most people.

Troubleshooting steps so far

Other than pausing the usbd process, I've been working with AppleCare and their engineers for several months to find out if this is a software issue and why is it happening with my iPhone XS and my MacBook Pro (model: 11,3, late-2013 Retina 15" running macOS Mojave 10.14.6) using the official Apple USB to Lighting Cable.

We have performed so many troubleshooting steps and most of these steps don't seem to fix it, except pausing the usbd process. However, Apple engineers refuse to believe the usbd process is causing the issue. The troubleshooting steps we have undertaken so far:

  • Reset NVRAM and SMC controller
  • Booted in SAFE Mode
  • Created a new user on my MacBook Pro
  • Installed a fresh partition and install of macOS Catalina 10.15
  • Reinstalled mobile device firmware package on my MacBook
  • Reset all iPhone settings (but not wiped it and reset to factory settings)
  • Deleted non-Apple launchdaemons on my Mac
  • Disabled anti-virus software (Intego's VirusBarrier) and VPNs on my Mac
  • Deleted the Mac's plist in the lockdown folder associated with my iPhone. This plist is used to check that the Mac and my iPhone have trusted each other previously
  • Reset privacy settings on my iPhone. Resetting privacy settings, similarly deletes the trust file on the iPhone which is used to check you have trusted the Mac, similar to the lockdown plist on the Mac
  • Triaged and booted my MacBook Pro into macOS High Sierra 10.13 at the Apple Genius Bar
  • Replaced the MacBook Pro's logic board and I/O board
  • Tried multiple iPhone XS at the Apple Genius Bar, and all exhibiting the same issue with their own Apple USB to Lighting Cables

After the Apple Genius Bar replaced the (perfectly fine) logic board and I/O board, they still exhibited the same connection issue with multiple iPhones at their store using their own Apple USB Lighting Cables. I'm not sure which iPhone models they tested, but they tried it with the iPhone XS and XS Max at the very least.

Interestingly, the only time the issue did not produce was when they took a completely new Lighting Cable from the shop floor. Consequently, they suggested it might be a Lighting Cable issue, but it doesn't explain why this only happens with some iPhones and some Mac models but doesn't affect other devices using the same (potentially faulty) cable?

Also, despite never having a frayed cable and store my cables appropriately, the new cables exhibit the issue within a month of using them, but again not with all Macs or with all iPhones?

My own investigations

Although I'm not 100% fluent with how the software works, I've tinkered around in terminal with some commands, deleted the lockdown plist file through rootless, read console log event messages relating to my iPhone connection; and tried searching online for possible solutions explaining what the usbd process does. But no solution so far fixes the issue.

Reading the man page description for the usbd process, I've found the usbd process is used to specifically configure iOS devices connected to the Mac. I don't believe it is used for any other USB connections, as it works fine with my external hard drives/flash drives.

The man page describes the usbd process as follows:

usbd allows the system to configure USB iOS devices to charge and to present notifications related to USB devices.

This command is not intended to be invoked directly

The only other thing I know about the usbd process is that it allows Macs to provide an additional 1600mA of power to iOS devices, when the maximum USB specification allows only 500mA of power. Pausing the usbd process, reduces the power output of the USB port to the standard 500mA, so it causes the iPhone to charge considerably slower, but gives you a stable connection. You can observe the difference in the power output running the command system_profiler SPUSBDataType in terminal.

When the usbd process is running, I get the following power output:

Current Available (mA): 500
Current Required (mA): 500
Extra Operating Current (mA): 1600
Sleep current (mA): 2100

Disabling usbd process and entering the above command results in the following power output:

Current Available (mA): 500
Current Required (mA): 500
Extra Operating Current (mA): 0

Furthermore, other than pausing the usbd process, the only other times the connection works is if my Mac is running Linux or Windows on a partition, but I don't think these provides the same power output as if it was running on macOS.

Conclusion and question

After doing so many troubleshooting steps with Apple, they suggest it's a USB Lighting cable issue, but this doesn't explain why the same cable works with other Macs or other devices.

The only real (but temporary) solution is to pause the usbd process, but as I've established that reduces the power output of the USB connection to the iPhone, meaning charging will take longer, albeit with a stable continual connection.


So to my question, would anyone be able to provide additional information as to what exactly does the usbd process do, and would anyone comment if this is a software bug or a physical Lighting cable issue?

I'd appreciate if anyone has any ideas as to what is the root cause of the problem, and hopefully we can find a fix for the many others affected by the same issue. Thank you very much for your time.


Please note, this is my first question on this stackexchange, so apologies if there's any issues with my post.

9
  • 2
    I would definitely say this is a software issue, looking at how many tries you gave this with other hardware...
    – X_841
    Commented Feb 13, 2020 at 6:48
  • Thanks @X_841 for your comment. I thought so too, but strange that Apple refuses to acknowledge it's a bug
    – AVelj
    Commented Feb 13, 2020 at 6:50
  • Well Apple is Apple sometimes... Do you have a local repair store? Call them, explain your issue and what you have done, I am sure they will confirm that you have outruled a hardware bug
    – X_841
    Commented Feb 13, 2020 at 6:51
  • @X_441, to be honest, the genius bar is the closest but also they did a lot of rigorous testing of the hardware. The only possible hardware related fault they can come up with is the cable. But again doesn't explain why it doesn't happen with every device.
    – AVelj
    Commented Feb 13, 2020 at 7:22
  • 1
    @Shawn the sudo killall -STOP -c usbd command will stop the process from running indefinitely until you restart your Mac or until you enter sudo killall -CONT -c usbd. Whereas quitting it from activity monitor will not stop it from restarting on its own..
    – AVelj
    Commented Jul 10 at 6:50

4 Answers 4

3

I had the same problem and I was thinking that my Mac had some current problem into the usb connectors. I solved the problem using usb to lightning cables from a different brand, certified for Apple devices. They appear to be a little more thick than the original ones. I saw that problem in various older iMac (2012-2014) and every time I solved using a cable from a different factory.

1
  • I've noticed that Apple's charging cables do not have very robust strain relief and sometimes go bad in a year. One way to improve them before they fail is to put shrink wrap over them, with about three millimeters of it over the hard plastic and enough on the cable to go a little past the builtin extra sheath.
    – WGroleau
    Commented Jul 18, 2020 at 18:09
3

Thank you so much for doing the legwork on investigating this issue! My mother-in-law has this issue every time she plugs in her iPhone to download photos, so I needed to find a simple solution for grandma to get her pics of her grandkids into her computer despite the constant disconnecting. Using the information @AVelj provided for the temporary fix, I created a LaunchDaemon to make it permanent. Here's what I did.

I created a shell script called connect-iPhone.sh that contained the following text:

#!/bin/bash
killall -STOP -c usbd

I stored it at /Users/<username>/Documents/connect-iPhone.sh

Then I created another file named pauseusbd.plist with the following text:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.pauseusbd.app</string>

        <key>Program</key>
        <string>/Users/<username>/Documents/connect-iPhone.sh</string>

        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

I saved that to /Library/LaunchDaemons. Then I used the following to make root the owner:

sudo chown root:wheel /Library/LaunchDaemons/pauseusbd.plist

Then I ran the following to load the plist so it runs on each reboot:

sudo launchctl load /Library/LaunchDaemons/pauseusbd.plist

Of course this will prevent Apple devices from charging faster than allowed by the USB spec, but it will also keep it connected. And that's all my grandkid-loving mother-in-law cares about. She's got a wall charger for charging.

I know this doesn't directly answer the why that the OP asked, but I wanted to provide a more permanent workaround for anyone else who is plagued by this issue. And thanks again to @AVelj for the thorough documentation!

References:

This post!

Plist in /System/Library/LaunchAgents not loading on reboot

What are the differences between LaunchAgents and LaunchDaemons?

2
  • This is exactly what I want to achieve. However, I think I followed all your steps correctly but I'm still having the same issue. If it worked for you, I don't know what might be going wrong here.
    – peacetype
    Commented Mar 30, 2022 at 8:35
  • Trying this out. Do I need to reboot for this to take effect?
    – Shawn
    Commented Jul 9 at 15:17
2

Thank you very much for the detailed report. I have the same problem on macOS 10.15.4, never had any problem with the same cable and the same iPhone on macOS 10.13.

The might have added some cable checks to usbd in order to stop unofficial cable usage.

There's a funny thing, though. Here on Catalina even when usbd has been killed this is the output of system_profiler SPUSBDataType:

 iPhone:

      Product ID: 0x12a8
      Vendor ID: 0x05ac (Apple Inc.)
      Version: 8.01
      Serial Number: [REDACTED]
      Speed: Up to 480 Mb/s
      Manufacturer: Apple Inc.
      Location ID: 0x14200000 / 18
      Current Available (mA): 500
      Current Required (mA): 500
      Extra Operating Current (mA): 1600
      Sleep current (mA): 2100

and it actually charges the iPhone pretty fast.

Is there any way to permanently disable usbd?

I also run locate usbd, here is /usr/share/sandbox/com.apple.usbd.sb:

;; Copyright (c) 2012 Apple Inc.  All Rights reserved.
;;
;; WARNING: The sandbox rules in this file currently constitute 
;; Apple System Private Interface and are subject to change at any time and
;; without notice. The contents of this file are also auto-generated and not
;; user editable; it may be overwritten at any time.
;;

(version 1)

(deny default)
(import "system.sb")

(allow distributed-notification-post)

(allow mach-per-user-lookup)

(allow file*
       (literal "/private/var/root/Library/Preferences/com.apple.usbd.plist")
)


(allow file-read*
       (literal "/AppleInternal")
       (literal "/usr/libexec")
       (literal "/usr/libexec/usbd")
       (literal "/private/var/root")
       (literal "/dev/console")
       (literal "/private/var/root/Library/Preferences/.GlobalPreferences.plist")
       (literal "/Library/Preferences/.GlobalPreferences.plist")
       (literal "/Library/Application Support/CrashReporter/SubmitDiagInfo.domains")
       (regex   "^/private/var/root/Library/Preferences/ByHost/\.GlobalPreferences\..*\.plist$")
)

(allow file-read-metadata
    (literal "/")
    (literal "/Library")
    (literal "/Library/Application Support/CrashReporter/SubmitDiagInfo.domains")
    (literal "/private")
    (literal "/private/var")
    (literal "/private/var/root")
)

;;crashtracer support

(allow system-socket)
(allow file-read-metadata
    (subpath "/Library/Application Support/CrashReporter/SubmitDiagInfo.domains")
    (literal "/Library/Caches/com.apple.DiagnosticReporting.HasBeenAppleInternal"))

(allow mach-lookup
    (global-name "com.apple.USBAgent")
    (global-name "com.apple.PowerManagement.control")
    (global-name "com.apple.SystemConfiguration.configd")
    (global-name-regex #"^com.apple.distributed_notifications")
)

(allow ipc-posix-shm
       (ipc-posix-name "apple.shm.notification_center")
)

(allow iokit-open
       (iokit-user-client-class "IOUSBDeviceUserClientV2")
)

Does this mean anything to anyone? I'd want to check the differences between usbd from 10.13 to 10.15.

6
  • Welcome to Ask Different. If no one can answer this, asking a follow on question and linking here is ideal. Great details that will help others, just people might not see your side question and look at this as an answer
    – bmike
    Commented Apr 22, 2020 at 20:56
  • 1
    @bmike thanks, and sorry for messing up
    – gio91ber
    Commented Apr 23, 2020 at 0:04
  • 1
    No worries. Welcome to the site. You are putting great content out.
    – bmike
    Commented Apr 23, 2020 at 1:26
  • Thanks @gio91ber for your response. Out of curiosity did you just kill it via the sudo command or via Activity Monitor? When I had troubleshooted my issue with macOS Catalina it was only 10.15.0/10.15.1 and found it still charged slowly, but this may have been fixed in later versions? Also in Mojave, there's a usbd file located in /usr/libexec/usbd. I believe you could stop it from loading but I'm not sure how to, especially as I'm not yet on Catalina.
    – AVelj
    Commented Apr 23, 2020 at 4:19
  • 1
    @gio91ber The reason why I asked if you ran the sudo command to stop the usbd process or if you killed it in Activity monitor, is because killing the usbd process will just restart the next time the iOS device is connected via USB to the Mac. But stopping the usbd process using the sudo killall -STOP -c usbd command, pauses it until you either reboot your Mac or enter sudo killall -CONT -c usbd command to continue the process. When the usbd process has been paused, it won't restart even if the iOS device has been connected to the Mac via usb.
    – AVelj
    Commented May 17, 2020 at 23:59
-1

usbd is supposed to be doing as you already mentioned and I least suspect it to be a problem.

It seems to me that this is a cable issue:

  1. Whenever you used new cable the issue was solved.
  2. cables after sometime loose their quality for several reasons.
  3. Newer iPhones requires more stable current. (Needs citation!)
18
  • 2
    How do you explain the cable issue when its working on the same MacBook with a different OS installed/running?
    – X_841
    Commented Feb 13, 2020 at 7:13
  • 1
    Also cables don't lose their quality (with normal usage) in a month!
    – X_841
    Commented Feb 13, 2020 at 7:14
  • 1
    So, your saying that Apple's own cables are not high quality enough to last longer than a mere month?
    – X_841
    Commented Feb 13, 2020 at 7:24
  • 1
    @NaveedAbbas yes a new cable works for a little period but then the issue starts within a month. But also why is the (supposed) faulty cable working with other devices but not my device?
    – AVelj
    Commented Feb 13, 2020 at 7:29
  • 1
    @NaveedAbbas again, it happened with multiple Lighting cables the Apple Genius Bar used and with their own iPhones connected to my Mac, we've also replaced my Mac's Logic Board and I/O Board, so I can't think the device connector has carbon interference? Also their cables and their iPhones worked with other Macs. Why not mine?
    – AVelj
    Commented Feb 13, 2020 at 7:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .