Using java syntax highliter for code snippets.

This commit is contained in:
Samuel Carlsson 2016-10-29 07:07:37 +02:00 committed by GitHub
parent 86ccd4ab42
commit c5197eab01

View File

@ -12,20 +12,26 @@ This projects aims at providing an up to date implementation of the ADB protocol
## Example ## ## Example ##
Usage cannot be simpler. Just create a `JadbConnection` and off you go. Usage cannot be simpler. Just create a `JadbConnection` and off you go.
JadbConnection jadb = new JadbConnection(); ```java
List<JadbDevice> devices = jadb.getDevices(); 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. 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. It's very easy to send and receive files from your android device, for example as below.
JadbDevice device = ... ```java
device.pull(new RemoteFile("/path/to/file.txt"), new File("file.txt")); 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. Some high level operations such as installing and uninstalling packages are also available.
JadbDevice device = ... ```java
new PackageManager(device).install(new File("/path/to/my.apk")); JadbDevice device = ...
new PackageManager(device).install(new File("/path/to/my.apk"));
```
## Protocol Description ## ## Protocol Description ##