You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MacOS Mojave下adb devices反复挂起无法识别设备求助

Fix for ADB Devices Hanging Permanently on macOS Mojave 10.14.6

Hi Tom, sorry to hear you're stuck with this frustrating adb hang issue—killing the 5037 port process working once but failing again definitely points to a persistent problem with the adb daemon or system permissions. Let's walk through targeted fixes tailored to your Mojave environment:

Step 1: Fully Purge All ADB Processes

Killing just the 5037 port process might leave lingering adb instances that cause the daemon to misbehave again. Use these commands to wipe all adb-related processes clean:

  • List all adb processes: ps aux | grep adb
  • Kill each process with the PID shown: kill -9 <PID_NUMBER>
  • Or use a one-liner to kill all adb processes at once: pkill -f adb

After this, run adb kill-server to ensure the daemon is fully stopped before restarting.

Step 2: Fix ADB Permissions with Sudo

Mojave's security restrictions often block adb from accessing USB devices properly. Try launching the adb server with elevated privileges:

  1. Run adb kill-server to stop any running daemon
  2. Start the server with sudo: sudo adb start-server
  3. Now run adb devices—if this works consistently, the issue was a permission bottleneck. Note that you may need to use sudo for subsequent adb commands, or adjust your user's USB permissions (see Step 3).

Step 3: Verify USB Device Permissions in System Preferences

Mojave requires explicit permission for apps to access USB devices. Here's how to check:

  1. Open System Preferences > Security & Privacy > Privacy tab
  2. Scroll down to USB in the left sidebar
  3. Look for entries related to "Android Debug Bridge" or "platform-tools"—make sure the checkbox next to them is enabled
  4. If you don't see the entry, try re-plugging your Android device and running adb devices again; this should trigger a permission prompt that you need to approve.

Step 4: Update ADB to the Latest Compatible Version

Older adb versions can have compatibility bugs with Mojave. Update your platform-tools:

  • If you use Android Studio, open the SDK Manager > SDK Tools and check for updates to "Android SDK Platform-Tools"
  • Alternatively, download the latest platform-tools package for macOS, unzip it, and replace your existing adb executable (usually located in ~/Library/Android/sdk/platform-tools/)

Step 5: Troubleshoot USB Connection Issues

Flaky USB connections can cause adb to hang unexpectedly:

  • Switch to a high-quality USB data cable (charging-only cables won't work for debugging)
  • Try a different USB port on your Mac (preferably a USB 2.0 port, as some USB 3.0 ports have compatibility issues with Android devices)
  • On your Android device, ensure USB Debugging is enabled in Developer Options, and select File Transfer (MTP) or PTP mode when prompted after connecting.

Step 6: Rule Out Third-Party Software Conflicts

Third-party tools like USB managers, antivirus software, or VPNs can interfere with adb's communication. Temporarily disable these apps, then repeat the adb process (kill server, start server, run adb devices) to see if the hang issue goes away.

If none of these steps work, you can try resetting your adb configuration by deleting the .android folder in your home directory (rm -rf ~/.android), then restarting the adb server. Just note this will wipe any saved adb device authorizations, so you'll need to re-approve your device's debugging prompt.

内容的提问来源于stack exchange,提问作者Tom Taylor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.07 00:49:04