@mcesystems/adb-kit 1.0.32 → 1.0.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/scripts/README.md CHANGED
@@ -1,183 +1,183 @@
1
- # Export ADB Resources Script
2
-
3
- This script downloads Android Debug Bridge (ADB) platform tools from Google and exports them to a specified target directory. The exported resources can be used by applications that depend on `@mcesystems/adb-kit`.
4
-
5
- ## Usage
6
-
7
- After installing `@mcesystems/adb-kit`:
8
-
9
- ```bash
10
- # Using the binary (recommended)
11
- npx export-adb-resources <target-path> [options]
12
-
13
- # Or run the script directly with tsx
14
- npx tsx node_modules/@mcesystems/adb-kit/scripts/export-resources.ts <target-path> [options]
15
- ```
16
-
17
- ### Arguments
18
-
19
- | Argument | Description |
20
- |----------|-------------|
21
- | `target-path` | Directory where resources will be exported |
22
-
23
- ### Options
24
-
25
- | Option | Description |
26
- |--------|-------------|
27
- | `--all` | Download resources for all platforms (Windows, macOS, Linux) |
28
- | `--platform <name>` | Download resources for a specific platform (`windows`, `darwin`, `linux`) |
29
- | `--help`, `-h` | Show usage information |
30
-
31
- ### Examples
32
-
33
- ```bash
34
- # Export for current platform only
35
- npx tsx export-resources.ts ./my-app/resources/adb-kit
36
-
37
- # Export for all platforms
38
- npx tsx export-resources.ts ./my-app/resources/adb-kit --all
39
-
40
- # Export for a specific platform
41
- npx tsx export-resources.ts ./my-app/resources/adb-kit --platform windows
42
- ```
43
-
44
- ### Output Structure
45
-
46
- The script creates the following directory structure:
47
-
48
- ```
49
- <target-path>/
50
- ├── bin/
51
- │ ├── darwin/ # macOS
52
- │ │ └── adb
53
- │ ├── windows/ # Windows
54
- │ │ ├── adb.exe
55
- │ │ ├── AdbWinApi.dll
56
- │ │ └── AdbWinUsbApi.dll
57
- │ └── linux/ # Linux
58
- │ └── adb
59
- └── licenses/
60
- └── APACHE-2.0.txt
61
- ```
62
-
63
- ---
64
-
65
- ## Prerequisites
66
-
67
- ### All Platforms
68
-
69
- 1. **Node.js 18+** with `tsx` available:
70
- ```bash
71
- npm install -g tsx
72
- # or use npx
73
- ```
74
-
75
- 2. **Internet connection** to download from Google's servers
76
-
77
- ### macOS / Linux
78
-
79
- - **unzip** command available (usually pre-installed)
80
-
81
- ### Windows
82
-
83
- - **PowerShell** available (included with Windows 10+)
84
-
85
- ---
86
-
87
- ## How It Works
88
-
89
- 1. Downloads the official platform-tools ZIP from Google's Android SDK repository
90
- 2. Extracts the required ADB binaries
91
- 3. Copies them to the target directory with proper permissions
92
- 4. Creates a license file for Apache 2.0 compliance
93
-
94
- ---
95
-
96
- ## Files Included
97
-
98
- ### Windows
99
- | File | Description |
100
- |------|-------------|
101
- | `adb.exe` | Android Debug Bridge executable |
102
- | `AdbWinApi.dll` | ADB Windows API library |
103
- | `AdbWinUsbApi.dll` | ADB Windows USB API library |
104
-
105
- ### macOS / Linux
106
- | File | Description |
107
- |------|-------------|
108
- | `adb` | Android Debug Bridge executable |
109
-
110
- ---
111
-
112
- ## Integrating with Your Application
113
-
114
- After exporting resources, configure `adb-kit` to use them:
115
-
116
- ### Option 1: Environment Variable
117
-
118
- Set `AdbBinPath` to point to the bin directory:
119
-
120
- ```bash
121
- # macOS
122
- export AdbBinPath=/path/to/resources/bin/darwin
123
-
124
- # Linux
125
- export AdbBinPath=/path/to/resources/bin/linux
126
-
127
- # Windows (PowerShell)
128
- $env:AdbBinPath = "C:\path\to\resources\bin\windows"
129
- ```
130
-
131
- ### Option 2: Bundle with Your App
132
-
133
- Copy the exported resources into your application's resources folder. The `adb-kit` package will automatically detect binaries in:
134
- - `<your-app>/resources/bin/darwin/` (macOS)
135
- - `<your-app>/resources/bin/linux/` (Linux)
136
- - `<your-app>/resources/bin/windows/` (Windows)
137
-
138
- ---
139
-
140
- ## Driver Requirements
141
-
142
- ### Windows
143
-
144
- On Windows, you may need to install USB drivers for your Android device:
145
-
146
- 1. **Google USB Driver** (for Nexus/Pixel devices):
147
- - Download from [Android Developer site](https://developer.android.com/studio/run/win-usb)
148
-
149
- 2. **Manufacturer drivers** (for other devices):
150
- - Check your device manufacturer's website
151
-
152
- ### macOS / Linux
153
-
154
- No additional drivers required. USB works out of the box.
155
-
156
- ### Linux udev Rules
157
-
158
- On Linux, you may need to add udev rules for your device:
159
-
160
- ```bash
161
- # Create udev rules file
162
- sudo nano /etc/udev/rules.d/51-android.rules
163
-
164
- # Add a rule for your device (example for Google devices)
165
- SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
166
-
167
- # Reload udev rules
168
- sudo udevadm control --reload-rules
169
- sudo udevadm trigger
170
- ```
171
-
172
- ---
173
-
174
- ## License
175
-
176
- ADB is licensed under **Apache License 2.0**.
177
-
178
- The binaries are downloaded from Google's official Android SDK repository:
179
- - https://developer.android.com/studio/releases/platform-tools
180
-
181
- Source code:
182
- - https://android.googlesource.com/platform/packages/modules/adb/
183
-
1
+ # Export ADB Resources Script
2
+
3
+ This script downloads Android Debug Bridge (ADB) platform tools from Google and exports them to a specified target directory. The exported resources can be used by applications that depend on `@mcesystems/adb-kit`.
4
+
5
+ ## Usage
6
+
7
+ After installing `@mcesystems/adb-kit`:
8
+
9
+ ```bash
10
+ # Using the binary (recommended)
11
+ npx export-adb-resources <target-path> [options]
12
+
13
+ # Or run the script directly with tsx
14
+ npx tsx node_modules/@mcesystems/adb-kit/scripts/export-resources.ts <target-path> [options]
15
+ ```
16
+
17
+ ### Arguments
18
+
19
+ | Argument | Description |
20
+ |----------|-------------|
21
+ | `target-path` | Directory where resources will be exported |
22
+
23
+ ### Options
24
+
25
+ | Option | Description |
26
+ |--------|-------------|
27
+ | `--all` | Download resources for all platforms (Windows, macOS, Linux) |
28
+ | `--platform <name>` | Download resources for a specific platform (`windows`, `darwin`, `linux`) |
29
+ | `--help`, `-h` | Show usage information |
30
+
31
+ ### Examples
32
+
33
+ ```bash
34
+ # Export for current platform only
35
+ npx tsx export-resources.ts ./my-app/resources/adb-kit
36
+
37
+ # Export for all platforms
38
+ npx tsx export-resources.ts ./my-app/resources/adb-kit --all
39
+
40
+ # Export for a specific platform
41
+ npx tsx export-resources.ts ./my-app/resources/adb-kit --platform windows
42
+ ```
43
+
44
+ ### Output Structure
45
+
46
+ The script creates the following directory structure:
47
+
48
+ ```
49
+ <target-path>/
50
+ ├── bin/
51
+ │ ├── darwin/ # macOS
52
+ │ │ └── adb
53
+ │ ├── windows/ # Windows
54
+ │ │ ├── adb.exe
55
+ │ │ ├── AdbWinApi.dll
56
+ │ │ └── AdbWinUsbApi.dll
57
+ │ └── linux/ # Linux
58
+ │ └── adb
59
+ └── licenses/
60
+ └── APACHE-2.0.txt
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Prerequisites
66
+
67
+ ### All Platforms
68
+
69
+ 1. **Node.js 18+** with `tsx` available:
70
+ ```bash
71
+ npm install -g tsx
72
+ # or use npx
73
+ ```
74
+
75
+ 2. **Internet connection** to download from Google's servers
76
+
77
+ ### macOS / Linux
78
+
79
+ - **unzip** command available (usually pre-installed)
80
+
81
+ ### Windows
82
+
83
+ - **PowerShell** available (included with Windows 10+)
84
+
85
+ ---
86
+
87
+ ## How It Works
88
+
89
+ 1. Downloads the official platform-tools ZIP from Google's Android SDK repository
90
+ 2. Extracts the required ADB binaries
91
+ 3. Copies them to the target directory with proper permissions
92
+ 4. Creates a license file for Apache 2.0 compliance
93
+
94
+ ---
95
+
96
+ ## Files Included
97
+
98
+ ### Windows
99
+ | File | Description |
100
+ |------|-------------|
101
+ | `adb.exe` | Android Debug Bridge executable |
102
+ | `AdbWinApi.dll` | ADB Windows API library |
103
+ | `AdbWinUsbApi.dll` | ADB Windows USB API library |
104
+
105
+ ### macOS / Linux
106
+ | File | Description |
107
+ |------|-------------|
108
+ | `adb` | Android Debug Bridge executable |
109
+
110
+ ---
111
+
112
+ ## Integrating with Your Application
113
+
114
+ After exporting resources, configure `adb-kit` to use them:
115
+
116
+ ### Option 1: Environment Variable
117
+
118
+ Set `AdbBinPath` to point to the bin directory:
119
+
120
+ ```bash
121
+ # macOS
122
+ export AdbBinPath=/path/to/resources/bin/darwin
123
+
124
+ # Linux
125
+ export AdbBinPath=/path/to/resources/bin/linux
126
+
127
+ # Windows (PowerShell)
128
+ $env:AdbBinPath = "C:\path\to\resources\bin\windows"
129
+ ```
130
+
131
+ ### Option 2: Bundle with Your App
132
+
133
+ Copy the exported resources into your application's resources folder. The `adb-kit` package will automatically detect binaries in:
134
+ - `<your-app>/resources/bin/darwin/` (macOS)
135
+ - `<your-app>/resources/bin/linux/` (Linux)
136
+ - `<your-app>/resources/bin/windows/` (Windows)
137
+
138
+ ---
139
+
140
+ ## Driver Requirements
141
+
142
+ ### Windows
143
+
144
+ On Windows, you may need to install USB drivers for your Android device:
145
+
146
+ 1. **Google USB Driver** (for Nexus/Pixel devices):
147
+ - Download from [Android Developer site](https://developer.android.com/studio/run/win-usb)
148
+
149
+ 2. **Manufacturer drivers** (for other devices):
150
+ - Check your device manufacturer's website
151
+
152
+ ### macOS / Linux
153
+
154
+ No additional drivers required. USB works out of the box.
155
+
156
+ ### Linux udev Rules
157
+
158
+ On Linux, you may need to add udev rules for your device:
159
+
160
+ ```bash
161
+ # Create udev rules file
162
+ sudo nano /etc/udev/rules.d/51-android.rules
163
+
164
+ # Add a rule for your device (example for Google devices)
165
+ SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
166
+
167
+ # Reload udev rules
168
+ sudo udevadm control --reload-rules
169
+ sudo udevadm trigger
170
+ ```
171
+
172
+ ---
173
+
174
+ ## License
175
+
176
+ ADB is licensed under **Apache License 2.0**.
177
+
178
+ The binaries are downloaded from Google's official Android SDK repository:
179
+ - https://developer.android.com/studio/releases/platform-tools
180
+
181
+ Source code:
182
+ - https://android.googlesource.com/platform/packages/modules/adb/
183
+