Enable USB debug mode on Moto G with a cracked or broken screen

This is for a Motorola Moto G XT1028. YMMV for other variations or generations of the phone, but these instructions are fairly generic. The important thing is that you are able to find the appropriate recovery image for your phone. For me, CWM and Philz Recovery didn't work, but TWRP did.

A lot of posts on XDA forums and Android StackExchange have steps for enabling USB debugging mode using the ADB shell. But what if you can't even see your device in "adb devices" in the first place? If your screen is broken and illegible, like mine was, you can't navigate via touch to enable debugging. This was the problem I faced. It took me several hours to really understand the solution.

I won't go into detail for most of these steps as there are many guides already:

  1. Restart the phone in fastboot mode and connect the USB cable from your PC
  2. From your PC's command line, run: fastboot devices
  3. 
    List of devices attached
    TA965XXXXX      fastboot
    
  4. If you see your phone's serial number with the word "fastboot" next to it, your phone is in the fastboot menu.
  5. Now we boot into our recovery image. Run: fastboot boot
  6. 
    C:\Installs\Recovery>fastboot boot twrp-3.1.1-0-falcon.img
    downloading 'boot.img'...
    OKAY [  0.327s]
    booting...
    OKAY [  0.239s]
    finished. total time: 0.571s
    
  7. Wait a minute or two for the phone to boot into the recovery mode
  8. Run: adb devices
  9. 
    List of devices attached
    TA965XXXXX      recovery
    
  10. You should see your phone's serial number with the word "recovery" next to it.
  11. Now run: adb shell
  12. If you don't mount the /system directory in read-write mode, you'd just be modifying temporary recovery /system files that won't persist when you reboot into your normal image. This step was the crucial one that I missed several times earlier, because the mount was never successful I simply copied and pasted from online instructions for other Android phones (in the links below). For the Moto G, the command is: mount -o rw /system
  13. Now you'll need to add the USB debug and ADB flags to the end of /system/build.prop. XDA post | StackExchange post
  14. 
    persist.service.adb.enable=1                                                    
    persist.service.debuggable=1
    persist.sys.usb.config=mtp,adb
    
  15. Now, you can reboot into your normal image. Run: adb shell reboot
  16. Once your phone has completed restarted, run adb devices again and you should see your device listed. If you get see an unauthorized status, check out this post to resolve that issue.
  17. 
    C:\Installs\Recovery>adb push c:\users\username\.android\adbkey.pub /data/misc/adb/adb_keys
    24 KB/s (716 bytes in 0.028s)
    
    C:\Installs\Recovery>adb shell reboot
    
    C:\Installs\Recovery>adb devices
    List of devices attached
    TA965XXXXX      device
    
    
  18. Now you can use a tool like Android Control to interact with the phone.

Comments

Popular posts from this blog

Domain registrar pricing comparison (2014)

How to block the Admiral anti ad-block detection message

usoclient.exe in Windows 10 wakes up my PC with Wake Source: Unknown