• Home
Name Date Size #Lines LOC

..--

.settings/06-Sep-2024-98

javatests/com/android/helper/aoa/06-Sep-2024-731509

src/com/android/helper/aoa/06-Sep-2024-1,078596

.classpathD06-Sep-2024703 1413

.projectD06-Sep-2024369 1817

Android.bpD06-Sep-20241.5 KiB5450

OWNERSD06-Sep-202481 32

README.mdD06-Sep-20241.1 KiB2722

README.md

1# AOA Helper
2Java utility which allows a host computer to act as a [USB host to an Android device](https://developer.android.com/guide/topics/connectivity/usb/) using [Android Open Accessory Protocol 2.0](https://source.android.com/devices/accessories/aoa2). The host can then send commands (e.g. clicks, swipes, keystrokes, and more) to a connected device without the need for ADB.
3
4## Usage
5Connect to a device using its serial number.
6```
7try (UsbHelper usb = new UsbHelper();
8     AoaDevice device = usb.getAoaDevice(serialNumber)) {
9    // ...
10}
11```
12
13Perform gestures using coordinates (`0 <= x <= 360` and `0 <= y <= 640`).
14```
15device.click(new Point(0, 0));
16device.swipe(new Point(0, 0), new Point(360, 640), Duration.ofMillis(100));
17```
18
19Write alphanumeric text or press key combinations using [USB HID usages](https://source.android.com/devices/input/keyboard-devices).
20```
21device.pressKeys(new AoaKey(0x04, AoaKey.Modifier.SHIFT), new AoaKey(0x52));
22```
23
24Press the power `device.wakeUp()`, home `device.goHome()`, or back `device.goBack()` buttons.
25
26## Testing
27Run the unit tests using `atest aoa-helper-test --host`.