• Stars
    star
    634
  • Rank 70,925 (Top 2 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 11 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

ADB Client in pure Java.

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 jitpack badge codecov first timers friendly

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.2.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.

  • 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.

More Repositories

1

NRasterizer

OpenType parser in pure c#
C#
38
star
2

UiMutilator

Testing framework for Android allowing to test interaction between multiple devices
Java
18
star
3

pascaljs

Pascal parser in js
JavaScript
8
star
4

Bugsense.WPF

WPF Client code for bugsense
C#
5
star
5

openeyetrackerbrowser

Browse, upgrade, and configure your Tobii Eye Tracker!
C++
5
star
6

hive

AI for the game Hive
JavaScript
4
star
7

ar

Pure python implementation of the ar archive format
Python
3
star
8

foomp

No frills animation system using pure python + ffmpeg. Sprinkled pycairo on top for good measure
Python
2
star
9

tsdf_raytracer

JS ray tracer for TSDF volumes
JavaScript
2
star
10

PocketGazeRecorder

Small, quick, and easy gaze recorder.
2
star
11

Tinyworld

An attempt on a Smallworld AI
C#
2
star
12

EulerProfile

Android app that displays your Project Euler profile.
C#
2
star
13

triangles

Python
1
star
14

ascii-geometry

Python
1
star
15

TimelapsGit

If you liked perforce timelaps view, you will like this!
C#
1
star
16

GypiAutoUpdater

Watches vcxproj files and updates gypi files accordlingly if possible
C#
1
star
17

fog

An android app that displays real time simulated fog on the screen!
Java
1
star
18

codenamez

Generates and connect code names with versions
Python
1
star
19

fysik2d

Super old physics engine
Java
1
star
20

NGTP

Go Text Protocol for .NET
C#
1
star
21

Menu-8bit

Java
1
star
22

dark-orange-ui

CSS
1
star
23

go-camera

Shell
1
star
24

kelewan

Javascript library for 2D pixel drawing
1
star
25

Mode13h.Wpf

Mode 13h comes to WPF!
C#
1
star
26

NProjective

Some sweet 3d-reconstruction code
C#
1
star
27

RebtelBlack

My rebtel prototype
C#
1
star
28

Ez-XBMC

C#
1
star
29

gray-lines

Python
1
star
30

keyforge

Python
1
star
31

dataset_samuel

Dataset for generating, tsdfs, etc
1
star
32

mini-malloc

C
1
star
33

haya2

CSS
1
star
34

WhistTournament

1
star
35

elfviz

Lightweight flask app that visualizes ELF files
Python
1
star
36

partition

Minimal partitions based on ordering constraints
Python
1
star
37

mesh_registration

Jupyter Notebook
1
star
38

ascii_viewer

JavaScript
1
star
39

nes3d

Displays 3d shapes on the NES
Python
1
star
40

diffraction

JavaScript
1
star
41

mini3d

C
1
star
42

mini-sfm

Jupyter Notebook
1
star
43

elgato-key-light

JavaScript
1
star
44

codestorm

Python
1
star
45

URT

You Are Traffic
C#
1
star
46

mininn

Minimist neural net in C
C
1
star
47

caverna

Caverna game logic with simple expect minimax algorithm
Python
1
star
48

CommentClassifier

C#
1
star
49

ProjectEuler

My Project Euler Code!
Python
1
star
50

RebtelBlack.Android

Java
1
star
51

dipra

DIffrentiable Polygon RAsterizer
C
1
star
52

vandra-8bit

Retro/terminal look in js sporting wireframe 3D
JavaScript
1
star
53

foot-map

Python
1
star
54

mini-field-interpolation

Jupyter Notebook
1
star