ADB Client in pure Java.
Go to file
Art f6e7da4f1f #58 connect command implemented and it`s test 2017-03-20 13:18:56 +03:00
.idea #58 skeleton implemented 2017-03-17 19:48:13 +03:00
META-INF Adding jar artifact 2014-04-02 19:44:28 +02:00
lib Removing unused jar 2016-03-03 07:36:29 +01:00
src/se/vidstige/jadb #58 connect command implemented and it`s test 2017-03-20 13:18:56 +03:00
test #58 connect command implemented and it`s test 2017-03-20 13:18:56 +03:00
.gitattributes Build: Cleaning up .gitignore & friends 2016-07-25 18:42:08 +02:00
.gitignore #58 connect command implemented and it`s test 2017-03-20 13:18:56 +03:00
.travis.yml Adding travis-ci build 2016-03-02 21:39:14 +01:00
CONTRIBUTING.md Adding short contributing text and link from README.md 2016-07-28 19:22:01 +02:00
LICENSE.md Adding the Apache 2.0 license 2014-02-24 07:53:11 +01:00
README.md correct version number for jitpack is v1.0.1 2017-03-13 09:56:27 +01:00
build.properties Build: Using JAVA_HOME to find jdk. 2016-03-03 07:29:34 +01:00
build.xml Running unit tests as part of travis build 2016-03-28 16:08:33 +02:00
jadb.properties Adding ant build (Generated with IntelliJ 15) 2016-03-03 06:56:15 +01:00
module_jadb.xml Adding ant build (Generated with IntelliJ 15) 2016-03-03 06:56:15 +01:00
pom.xml #58 connect command implemented and it`s test 2017-03-20 13:18:56 +03:00
release.sh Adding release script 2016-11-10 06:46:57 +01:00

README.md

#JADB# ADB client implemented in pure Java.

The Android Debug Bridge or ADB for short it a client-server architecture used to install android apps from an IDE or command line and to debug apps, etc.

The Android SDK Tools is available for the major platforms (Mac, Windows & Linux) and in there is a command line tool called adb that implements the ADB protocol.

This projects aims at providing an up to date implementation of the ADB protocol.

Build Status

Example

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"));

Protocol Description

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

Using JADB in your application

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.0.1</version>
</dependency>

Troubleshooting

If you cannot connect to your device check the following.

  • Your adb server is running by issuing adb start-server
  • You can see the device using adb adb devices

If you see the device in adb but not in jadb please file an issue on https://github.com/vidstige/jadb/.

Workaround for Unix Sockets Adb Server

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

Contributing

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.

Authors

Samuel Carlsson samuel.carlsson@gmai.com

See contributors for a full list.

License

This project is released under the Apache License Version 2.0, see LICENSE.md for more information.