Code Monkey home page Code Monkey logo

jadb's Introduction

JADB

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.

Build Status codecov

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

The description for the protocol for transferring files can be found here: SYNC.TXT.

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.1.0</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.

  • If you fix a bug, try to first create a failing test. Reach out to me for assistance or guidance if needed.

Authors

Samuel Carlsson [email protected]

See contributors for a full list.

License

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

jadb's People

Contributors

anthonyflynn avatar bryant1410 avatar cfig avatar danielfriederich avatar dependabot[bot] avatar dllewellyn avatar ernytech avatar fashioncj avatar giemsa avatar gwpantazes avatar janosvitok avatar jevalen4868 avatar muhikhsan101 avatar nuumio avatar phantamanta44 avatar raiman avatar root-intruder avatar skart1 avatar smieras avatar tg44 avatar tmyroadctfig avatar vidstige avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.