Drücke „Enter”, um zum Inhalt zu springen.

How to fix adb devices message unauthorized device on macOS

rc-admin

You want to run and test an app on a real hardware device? But what if your device is not showing when you connect your android mobile using USB Cable? What can you do if your device is not displayed on the target drop-down menu in the toolbar of Android Studio? How to fix „adb devices“ shows „unauthorized“ device?

With Android Studio for Mac you can use an Android device for testing and debugging over an Android Debug Bridge (ADB) connection. Therefore you have to enable USB debugging under Settings > Developer options.

What can you do if your device is not displayed on the target drop-down menu in the toolbar of Android Studio?

  1. Go to the directory /Users/<your_user>/Library/Android/sdk/platform-tools with „cd /Users/ridvan/Library/Android/sdk/platform-tools“
  2. Run the command „./adb devices„. If the result shows an unauthorized device:
  1. Disconnect USB connection between Mac/MacBook and Android device.
  2. Stop adb server by running „./adb kill-server“ in command window
  3. On device use „Revoke USB debugging authorizations“ in „Developer Options“

  1. On Mac/MacBook delete „adbkey“ file in directory „~/.android/“ by running
    the commands
    • cd ~/.android/
    • rm -rf adbkey
  1. Reconnect the device to the Mac/MacBook
  2. Open a command window and enter „./adb devices„. Watch the device’s screen for any Authorization message and allow the connection. The device should now show as „device“.

Die Kommentare sind deaktiviert.