goadb

module
v0.0.0-...-5a7d9e1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2023 License: MIT

README

goadb

ADB client written in pure Go.

Currently only connections over TCP are supported, but the project is built in such a way that adding support for USB should be simple (see Medium.go).

Build

Compile the binary using

go build -o build/ ./...

or just use make if you have make installed.

Usage

Run the demo binary using

./build/goadb -k $PATH_TO_YOUR_PRIVATE_KEY_FILE $ANDROID_DEVICE_IP:$ANDROID_DEVICE_PORT

where:

  • $PATH_TO_YOUR_PRIVATE_KEY_FILE is the path to an RSA 2048 private key in PEM format, which you can generate using openssl genrsa
  • $ANDROID_DEVICE_IP is the IP address of your Android device, which you can see in your Android settings → System → Developer options → Wireless debugging
  • $ANDROID_DEVICE_PORT is the port of the adb server on your Android device, which you can see in your Android settings → System → Developer options → Wireless debugging. If you have "Wireless ADB debugging" turned on in Developer options, you may also use port 5555.

Note that to use ADB, you need to enable Developer options on your phone, which you can do by tapping 7 times on Android settings → About phone → Build number.

Acknowledgments

The library was built based on

Contribute

Currently the project can "only" do a handshake and send raw messages. Implementing the remaining ADB messages on a higher level should not be too hard, so feel free to clone and contribute. The library probably needs some adaptations when large files are transmitted, because currently the entire message is buffered in memory.

Directories

Path Synopsis
cmd
pkg
adb

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL