How to solve ADB device unauthorized in Android ADB host device?

后端 未结 13 1433
情话喂你
情话喂你 2020-12-07 11:04

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

13条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 11:59

    If anyone has similar issue of having a phone with a cracked screen and has a need to access adb:

    1. Root your phone (mine was already rooted, so I was blessed at least with that).

    If you forgot to enable developers mode and your adb isn't running, then do the following:

    1. Reboot your phone into recovery.
    2. Connect the phone with a cable.
    3. Open terminal.
    4. If you type adb devices you should see the device in the list.
    5. If so, type:

      adb shell mount /system
      abd shell
      
      echo "persist.service.adb.enable=1" >> default.prop 
      echo "persist.service.debuggable=1" >> default.prop
      echo "persist.sys.usb.config=mtp,adb" >> default.prop
      echo "persist.service.adb.enable=1" >> /system/build.prop 
      echo "persist.service.debuggable=1" >> /system/build.prop
      echo "persist.sys.usb.config=mtp,adb" >> /system/build.prop
      

    Now if you are going to reboot into your phone android will tell you "oh your adb is working but please tap on this OK button, so we can trust your PC". And obviously if we can't tap on the phone stay in the recovery mode and do the following (assuming you are not in the adb shell mode, if so first type exit):

    cd ~/.android
    adb push adbkey.pub /data/misc/adb/adb_keys
    
    1. Hurray, it all should be hunky-dory now! Just reboot the phone and you should be able to access adb when the phone is running:

      adb shell reboot

    P.S. Was using OS X and Moto X Style that's with the cracked screen.

提交回复
热议问题