Skip to content

bonianchen/bonian_blog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Wireless Debug Android Without PC

This is a project regarding having more control over an Android device without rooting it.

My Target

Within Android, Android Debug Bridge (adb) provides a capability (as a shell user priviledge) for Android developers to debug and develope.

shell user priviledge allows me to run my backend on an Android device without having too much of the restrictions, and is the candidate I'm looking for.

Therefore, run commands under this condition is my target.

Issues

To access Android Debug Bridge (adb), normally a developer requires a PC to get connect with it either through USB or internet.

Due to my development of backend software was fully setup on top of an Android device, route command and data out of Android device to a PC and route back again simply for accessing adb is over-killing.

Route commands through internet seems to be a good idea to me, however, the wireless debugging feature (introduced since Android 11) enables debugging port only when presenting the pairing information after user clicked the Pair device with pairing code button.

The randomly generated pairing information got dismissed when leaving this Settings UI page.

Workaround Steps

  1. Having following apps installed (through F-Droid):
  1. Adjust Developer options within Settings app

    Wireless debugging:
    Set to ON
    Allow screen overlays on Settings:
    Set to ON
  2. Close Settings app

  3. Launch Termux:Float

    A terminal would be float on screen

  4. Launch Settings app again

    Termux:Float remains stay on top of Settings app

  5. Clicked the Pair device with pairing code button within Wireless debugging

    A pop-up dialog show-up with pairing information

  6. Move focus to Termux:Float and issue pairing commands:

    1. adb pair localhost:[port number] [pair code]
     
    2. adb connect localhost:[connect port]
  7. Verify the status of pairing

  8. Troubleshooting

    Some users reported unable to pair due to certificate issues There're two options which might help:

    1. Get into ~/.android/ folder within Termux (or Termux:Float) Issue command: adb keygen

    2. Issue command ps axw and kill suspicious process as much as possible.

    Author

    [LinkedIn](https://www.linkedin.com/in/bonian-chen-6781635a)
    

    History

    2023/06/29 First Draft
    

About

Some practice on writing.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published