June 30, 2023

Android Studio - ADB

This is not part of Android studio, but is part of the SDK (or so I hope).

ADB is "android debug bridge" and is a swiss army knife capable of all kinds of things.

Where is it?

I use Android studio: Tools -- SDK manager to track down where the SDK I have are located. They are at:
/u1/home/tom/Android/Sdk
After some poking around, I find:
/u1/home/tom/Android/Sdk/platform-tools/adb
Since I intend to use it now and then, I do this:
cd /u1/home/tom/Android/Sdk/platform-tools/adb
cp adb /home/tom/bin
I'll note in passing that the Android studio SDK manager tells me I have three SDK platforms installed:

How to use it

Just typing "adb" tells me this is version 1.0.41 (version 34.0.3-10161052).
Just typing "adb" (or "adb help") also gives me a bunch of help.

I find a USB cable and connect my Pixel 6 phone to my linux computer. The phone launches a dialog to ask me if I want to allow USB debugging. I tell it to always allow this computer, then tap allow.

I had already turned on developer options on my phone.

adb devices
This shows me a device, presumably the Pixel 6.
adb shell
This gives me an interactive shell, and looks like a linux system. I can use df, ls, pwd, cd, mount, even uname -a.
Typing "whoami" tells me I am user "shell".

Other exciting possibilities:


Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]