oSumAtrIX 4955fb15a9 build: Change group id to `app.revanced` | 1 rok pred | |
---|---|---|
.github | 2 rokov pred | |
.idea | 7 rokov pred | |
META-INF | 10 rokov pred | |
build | 6 rokov pred | |
lib | 8 rokov pred | |
src | 2 rokov pred | |
test | 2 rokov pred | |
.gitattributes | 8 rokov pred | |
.gitignore | 7 rokov pred | |
CONTRIBUTING.md | 6 rokov pred | |
LICENSE.md | 10 rokov pred | |
README.md | 2 rokov pred | |
pom.xml | 1 rok pred | |
release.sh | 8 rokov pred |
ADB client implemented in pure Java.
The Android Debug Bridge (ADB) is a client-server architecture used to communicate with Android devices (install APKs, debug apps, etc).
The Android SDK Tools are available for the major platforms (Mac, Windows & Linux) and include the adb
command line tool which implements the ADB protocol.
This projects aims at providing an up to date implementation of the ADB protocol.
Usage cannot be simpler. Just create a JadbConnection
and off you go.
JadbConnection jadb = new JadbConnection();
List<JadbDevice> devices = jadb.getDevices();
Make sure the adb server is running. You can start it by running adb
once from the command line.
It's very easy to send and receive files from your android device, for example as below.
JadbDevice device = ...
device.pull(new RemoteFile("/path/to/file.txt"), new File("file.txt"));
Some high level operations such as installing and uninstalling packages are also available.
JadbDevice device = ...
new PackageManager(device).install(new File("/path/to/my.apk"));
An overview of the protocol can be found here: Overview
A list of the available commands that a ADB Server may accept can be found here: Services
The description for the protocol for transferring files can be found here: SYNC.TXT.
Since version v1.1 Jadb support maven as a build system. Although this project is not presented in official apache maven repositories this library can be used as dependencies in your maven/gradle project with the help of jitpack. Jitpack is a system which parses github public repositories and make artifacts from them. You only need to add jitpack as a repository to let maven/gradle to search for artifacts in it, like so
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
After that you will need to add actual dependency. Jitpack takes groupId, artifactId and version id from repository name, project name and tag ignoring actual values from pom.xml. So you need to write:
<dependency>
<groupId>com.github.vidstige</groupId>
<artifactId>jadb</artifactId>
<version>v1.2.1</version>
</dependency>
If you cannot connect to your device check the following.
adb start-server
adb devices
If you see the device in adb
but not in jadb
please file an issue on https://github.com/vidstige/jadb/.
Install socat
and issue the following to forward port 5037 to the unix domain socket.
socat TCP-LISTEN:5037,reuseaddr,fork UNIX-CONNECT:/tmp/5037
This project would not be where it is, if it where not for the helpful contributors supporting jadb with pull requests, issue reports, and great ideas. If you would like to contribute, please read through CONTRIBUTING.md.
Samuel Carlsson samuel.carlsson@gmail.com
See contributors for a full list.
This project is released under the Apache License Version 2.0, see LICENSE.md for more information.