|
1 |
| -# adb-proxy |
| 1 | +# ADB Proxy - Portable Executable |
2 | 2 |
|
3 |
| -Lightweight local proxy to be packaged and used for working with adb commands. |
| 3 | +This ADB proxy creates portable executables that don't require Node.js or ADB to be installed locally. |
4 | 4 |
|
5 |
| -## Prerequisites |
| 5 | +## For End Users |
6 | 6 |
|
7 |
| -1. [ADB Tools](https://developer.android.com/tools/releases/platform-tools) are locally available. |
8 |
| -2. Ensure Android device has USB Debugging enabled. |
| 7 | +### Quick Start |
9 | 8 |
|
10 |
| -## How to use |
| 9 | +1. **Download** the appropriate build for your platform from releases |
| 10 | +2. **Extract** the archive to any folder |
| 11 | +3. **Connect** your Android device with USB debugging enabled |
| 12 | +4. **Double-click** the startup script: |
| 13 | + - **Windows**: `start.bat` |
| 14 | + - **macOS**: `start.command` |
| 15 | + - **Linux**: `start.sh` |
11 | 16 |
|
12 |
| -```sh |
13 |
| -cd adb-proxy |
| 17 | +The proxy will start on `http://localhost:3080` |
| 18 | + |
| 19 | +## For Developers |
| 20 | + |
| 21 | +### Building Executables |
| 22 | + |
| 23 | +```bash |
| 24 | +# Install dependencies |
14 | 25 | yarn install
|
15 |
| -yarn start |
| 26 | + |
| 27 | +# Build for specific platforms |
| 28 | +yarn build-windows # Creates dist/windows/ |
| 29 | +yarn build-linux # Creates dist/linux/ |
| 30 | +yarn build-macos # Creates dist/macos/ |
| 31 | + |
| 32 | +# Build for all platforms |
| 33 | +yarn build-all |
16 | 34 | ```
|
17 | 35 |
|
18 |
| -Local proxy should now be running on http://localhost:3080. |
| 36 | +### How It Works |
19 | 37 |
|
20 |
| -To confirm it works: |
| 38 | +The build process uses [@yao-pkg/pkg](https://github.com/yao-pkg/pkg) (maintained fork) to create standalone executables: |
21 | 39 |
|
22 |
| -First, connect your Android device to the computer (and allow any relevant permissions related to debugging) |
| 40 | +1. **pkg** bundles the Node.js application into a single executable |
| 41 | +2. **build-platforms.js** downloads platform-specific ADB binaries |
| 42 | +3. **Everything** is packaged together with startup scripts |
23 | 43 |
|
24 |
| -1. Run the following to display the id(s) of the currently connected Android device(s): |
| 44 | +### Distribution |
25 | 45 |
|
26 |
| -```sh |
27 |
| -curl -X POST http://localhost:3080/run-adb \ |
28 |
| - -H "Content-Type: application/json" \ |
29 |
| - -d '{ "command": "devices" }' |
| 46 | +Each platform build creates a `dist/{platform}/` directory with: |
| 47 | + |
| 48 | +``` |
| 49 | +📁 dist/windows/ 📁 dist/macos/ 📁 dist/linux/ |
| 50 | +├── 🟢 start.bat ├── 🟢 start.command ├── 🟢 start.sh |
| 51 | +├── 🔧 adb.exe ├── 🔧 adb ├── 🔧 adb |
| 52 | +├── ⚙️ adb-proxy.exe ├── ⚙️ adb-proxy ├── ⚙️ adb-proxy |
| 53 | +├── 📄 adbwinapi.dll ├── 📄 README.txt ├── 📄 README.txt |
| 54 | +├── 📄 adbwinusbapi.dll └── 📚 USER-GUIDE.md └── 📚 USER-GUIDE.md |
| 55 | +├── 📄 README.txt |
| 56 | +└── 📚 USER-GUIDE.md |
30 | 57 | ```
|
31 | 58 |
|
32 |
| -2. Observe that the connected device(s) is returned in the result. |
| 59 | +### File Sizes |
33 | 60 |
|
34 |
| -OR |
| 61 | +- **Windows**: ~52MB |
| 62 | +- **macOS**: ~75MB |
| 63 | +- **Linux**: ~63MB |
35 | 64 |
|
36 |
| -1. Navigate to the Test Queue, inspect the page and remove the `display: none` style from the last `<div>` in the `<main>`. |
37 |
| -1. That should reveal a 'List Devices' button. Pressing that button displays the device id(s) of the Android device(s) currently connected to the computer. |
| 65 | +## Development |
38 | 66 |
|
39 |
| -TODO: |
| 67 | +### Project Structure |
40 | 68 |
|
41 |
| -1. Whitelist the remaining adb commands currently used in the `aria-at-talkback-capture` scripts |
42 |
| -1. Rework the current server's `api/scripts` endpoints and the capture utterances web socket implementation to be usable by this proxy |
43 |
| -1. Package this proxy as a portable executable so testers won't have to install node (or adb) locally |
44 |
| -1. If the above cannot be easily done for adb, provide an easy way to pull and add ADB to a tester's PATH depending on platform, and easily remove afterwards |
45 |
| -1. Tests(?) |
| 69 | +``` |
| 70 | +adb-proxy/ |
| 71 | +├── adb-proxy.js # Main server application |
| 72 | +├── capture-utterances.js # TalkBack capture logic |
| 73 | +├── build-platforms.js # Build system for all platforms |
| 74 | +├── package.json # Dependencies and build scripts |
| 75 | +└── dist/ # Built executables (generated) |
| 76 | + ├── windows/ |
| 77 | + ├── linux/ |
| 78 | + └── macos/ |
| 79 | +``` |
0 commit comments