Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Jiab77/82a2709db8dff92425b055b3ec3a797c to your computer and use it in GitHub Desktop.

Select an option

Save Jiab77/82a2709db8dff92425b055b3ec3a797c to your computer and use it in GitHub Desktop.
Running ADB on and from your own Android device -- Part 1

Running ADB on and from your own Android device -- Part 1

Almost everybody knows how to run adb on remote devices but do you know that you can mostly use the same technique for running adb on your own device?

Caution

If you have no idea about what adb is for Android devices, then this gist is not made for you. You must have an advanced knowledge level about Android devices to continue.

Important

You must have Android 11 or later before continue. Previous versions don't have built-in wireless debugging support.

During my tests, I've found two methods for running adb locally:

  1. Using Termux
  2. Using aShell You

To install these applications, you will need to install Droid-ify first.

Note

Google have decided to force all developpers to register to a central authority. This will endanger projects and services like F-droid and so by extention IzzyOnDroid repo and the Droid-ify project.

You can read more about it here: https://f-droid.org/2025/09/29/google-developer-registration-decree.html

Content

Required steps

Important

I'm assuming that you've already enabled Developper Options on your Android device.

Disable automatic blocking (if enabled)

Go to Settings -> Security / Confidentiality -> Automatic Blocking

Enabled Automatic Blocking Enabled
Disabled Automatic Blocking Disabled

Enable USB and Wireless debugging

Example when USB and Wireless debugging are enabled USB and Wireless debugging

Tip

If the USB and Wireless debugging options are disabled then make sure that you've disabled the Automatic Blocking feature in the security settings of your device.

Example when Automatic Blocking is enabled USB and Wireless debugging options disabled

Method 1: Termux

Install Termux from Droidify or F-Droid and do the following:

Note

If you don't have adb already installed, run the following command before continuing:

apt update && apt install -y android-debug-tools

1. Close all applications and keep only Termux and Wireless USB debugging settings image
2. Tap and Hold the Termux application and slide it down to initialize multiscreen feature then select the Settings application Enabled multiscreen feature
3. Get ADB pairing code Get ADB pairing port and code for Termux
4. Run the following commands in Termux (don't forget to change pairing port and code accordingly) Set ADB pairing port and code in Termux

Optional steps:

5. Connect with aShell You (optional) Connect to ADB from aShell You
6. Run ADB command with aShell You (optional) Run ADB command from aShell You
7. Resize Termux application (optional) Resize Termux application from multiscreen
8. Slide up to put Termux in full screen (optional) Termux in full screen

Method 2: aShell You

Install aShell You from Droidify and do the following:

1. Select ADB via Wireless Debugging option ADB via Wireless Debugging option
2. Connect a new device Connect a new device
3. Connect this device Connect this device

Important

You should have received a new notification from the aShell You application for entering the adb pairing code.

4. Get ADB pairing code Get ADB pairing code

Important

In the notification sent from the aShell You application, tap SUBMIT and paste the adb pairing code.

5. Check if the device has been paired Check if the device has been paired
6. Go back to aShell You application and repeat step 1 then select your device Connect new device
7. Run ADB command to see if it works Example of 'adb shell date' command
8. Start Termux and run adb devices (optional) Connected device from Termux

Tip

If you have several connected devices, run adb devices -l instead and use adb -t <device-id> to run commands on defined device ID.

Want more?

You want more? Want to know what you can do once you have adb working locally on your Android device?

Simply go to the next part of this gist ๐Ÿ˜œ

References

Thanks

I'd like to thank the following persons:

  • K3RN3L P4N1K for his help with Termux:Widget (more about that in next part ๐Ÿ˜‰ )
  • Skyper from the THC group for his help and support in general

Thank you guys!

Author

  • Jiab77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment