本文介绍了如何解决Android ADB主机设备中未经授权的ADB设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用扎根的Android设备作为ADB主机将adb命令 adb设备发送给Samsung S4时,我收到了设备未授权的错误消息。但是,当我尝试使用adb到Samsung Galaxy Nexus时,它工作正常。谁能建议我解决三星S4问题?

When I'm using a rooted Android device as ADB host to send adb command "adb devices" to Samsung S4, I received device unauthorized error message. However when I tried adb to Samsung Galaxy Nexus, it is working fine. Can anyone advise how to solve my Samsung S4 problem?

=========================================
# adb devices
List of devices attached
4d00f9169907301b        unauthorized
=========================================

预先感谢。

编辑:
发现此问题仅发生在Android 4.2.2及更高版本上。以下链接说明Google已为使用adb实现了一些新的安全功能。

Found that this problem only happened to Android 4.2.2 and above. The following link explained that Google has implemented some new security features for using adb.

感谢是否有人可以提供帮助。

Appreciate if anyone can help on this.

推荐答案


  • 从客户端电话(adb主机)获取公钥

    • Get the public key from the client phone (adb host)

      cat /data/.android/adbkey.pub

      cat /data/.android/adbkey.pub

      将上述公钥复制到目标电话的 / data / misc / adb / adb_keys 位置。 (您可能需要先通过 stop adbd 停止adb守护程序)

      copy the above public key to the target phone's /data/misc/adb/adb_keys location. (you may need to stop the adb daemon first with stop adbd)

      cat / data / misc / adb / adb_keys

      cat /data/misc/adb/adb_keys

      验证两个 cat 输出是否匹配。

      verify both cat outputs match.

      尝试在目标启动adbd 上重新启动adb守护程序,或者只是重新启动它们。

      try restarting adb daemon on target start adbd or just reboot them.

      如果在上述步骤中读写ADB KEY时遇到问题,请。请参考更多详细信息

      If you are having problems reading or writing to ADB KEYS in above steps, try setting environment variable ADB_KEYS_PATH with a temporary path (eg: /data/local/tmp). Refer to that link it goes into more details

          "On the host, the user public/private key pair is automatically generated,
          if it does not exist, when the adb daemon starts and is stored in
          $HOME/.android/adb_key(.pub) or in $ANDROID_SDK_HOME on windows. If needed,
          the ADB_KEYS_PATH env variable may be set to a :-separated (; under
          Windows) list of private keys, e.g. company-wide or vendor keys.
      
          On the device, vendors public keys are installed at build time in
          /adb_keys. User-installed keys are stored in /data/misc/adb/adb_keys"
      

      这篇关于如何解决Android ADB主机设备中未经授权的ADB设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 00:31
查看更多