@mcesystems/apple-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.
Files changed (29) hide show
  1. package/README.md +284 -284
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs.map +1 -1
  4. package/dist/types/utils/portManager.d.ts +68 -0
  5. package/dist/types/utils/portManager.d.ts.map +1 -0
  6. package/package.json +1 -1
  7. package/scripts/README.md +209 -209
  8. package/scripts/build-windows.sh.template +134 -134
  9. package/scripts/export-resources.mts +690 -690
  10. package/dist/resources/bin/darwin/idevice_id +0 -0
  11. package/dist/resources/bin/darwin/idevicedebug +0 -0
  12. package/dist/resources/bin/darwin/idevicediagnostics +0 -0
  13. package/dist/resources/bin/darwin/ideviceinfo +0 -0
  14. package/dist/resources/bin/darwin/ideviceinstaller +0 -0
  15. package/dist/resources/bin/darwin/idevicename +0 -0
  16. package/dist/resources/bin/darwin/idevicepair +0 -0
  17. package/dist/resources/bin/darwin/idevicescreenshot +0 -0
  18. package/dist/resources/bin/darwin/idevicesyslog +0 -0
  19. package/dist/resources/bin/darwin/iproxy +0 -0
  20. package/dist/resources/bin/darwin/libcrypto.3.dylib +0 -0
  21. package/dist/resources/bin/darwin/libimobiledevice-1.0.6.dylib +0 -0
  22. package/dist/resources/bin/darwin/libimobiledevice-glue-1.0.0.dylib +0 -0
  23. package/dist/resources/bin/darwin/liblzma.5.dylib +0 -0
  24. package/dist/resources/bin/darwin/libplist-2.0.4.dylib +0 -0
  25. package/dist/resources/bin/darwin/libssl.3.dylib +0 -0
  26. package/dist/resources/bin/darwin/libusbmuxd-2.0.7.dylib +0 -0
  27. package/dist/resources/bin/darwin/libzip.5.dylib +0 -0
  28. package/dist/resources/bin/darwin/libzstd.1.dylib +0 -0
  29. package/dist/resources/licenses/LGPL-2.1.txt +0 -33
package/scripts/README.md CHANGED
@@ -1,209 +1,209 @@
1
- # Export Apple Resources Script
2
-
3
- This script exports libimobiledevice binaries and their dependencies to a specified target directory. The exported resources can be used by applications that depend on `@mcesystems/apple-kit`.
4
-
5
- ## Usage
6
-
7
- After installing `@mcesystems/apple-kit`:
8
-
9
- ```bash
10
- # Using the binary (recommended)
11
- npx export-apple-resources <target-path>
12
-
13
- # Or run the script directly with tsx
14
- npx tsx node_modules/@mcesystems/apple-kit/scripts/export-resources.ts <target-path>
15
- ```
16
-
17
- ### Examples
18
-
19
- ```bash
20
- # Export to a relative path
21
- npx tsx export-resources.ts ./my-app/resources/apple-kit
22
-
23
- # Export to an absolute path
24
- npx tsx export-resources.ts /Users/me/projects/my-app/resources
25
- ```
26
-
27
- ### Output Structure
28
-
29
- The script creates the following directory structure:
30
-
31
- ```
32
- <target-path>/
33
- ├── bin/
34
- │ ├── darwin/ # macOS binaries and dylibs
35
- │ │ ├── idevice_id
36
- │ │ ├── ideviceinfo
37
- │ │ ├── iproxy
38
- │ │ ├── libimobiledevice-1.0.6.dylib
39
- │ │ └── ... (other tools and dylibs)
40
- │ └── windows/ # Windows binaries and DLLs
41
- │ ├── idevice_id.exe
42
- │ ├── ideviceinfo.exe
43
- │ ├── iproxy.exe
44
- │ ├── libimobiledevice-1.0-6.dll
45
- │ └── ... (other tools and DLLs)
46
- ├── licenses/
47
- │ └── LGPL-2.1.txt
48
- └── build-windows.sh # Windows build script (generated on non-Windows)
49
- ```
50
-
51
- ---
52
-
53
- ## Platform-Specific Prerequisites
54
-
55
- ### macOS
56
-
57
- #### Prerequisites
58
-
59
- 1. **Homebrew** installed ([https://brew.sh](https://brew.sh))
60
-
61
- 2. **libimobiledevice tools** installed via Homebrew:
62
- ```bash
63
- brew install libimobiledevice ideviceinstaller
64
- ```
65
-
66
- 3. **Node.js 18+** with `tsx` available:
67
- ```bash
68
- npm install -g tsx
69
- # or use npx
70
- ```
71
-
72
- #### How It Works
73
-
74
- On macOS, the script:
75
- 1. Locates Homebrew installation (`/opt/homebrew` for Apple Silicon, `/usr/local` for Intel)
76
- 2. Copies required binaries (`idevice_id`, `ideviceinfo`, `iproxy`, etc.)
77
- 3. Recursively collects all dylib dependencies
78
- 4. Fixes dylib paths using `install_name_tool` to use `@loader_path` (makes binaries portable)
79
-
80
- #### Running
81
-
82
- ```bash
83
- cd scripts/export-apple-resources
84
- npx tsx export-resources.ts /path/to/output
85
- ```
86
-
87
- ---
88
-
89
- ### Windows
90
-
91
- #### Prerequisites
92
-
93
- 1. **MSYS2** installed from [https://www.msys2.org](https://www.msys2.org)
94
- - Download and run the installer
95
- - Default installation path: `C:\msys64`
96
-
97
- 2. **Required MSYS2 packages** - Open **MSYS2 MinGW 64-bit** shell and run:
98
- ```bash
99
- pacman -S base-devel \
100
- git \
101
- mingw-w64-x86_64-gcc \
102
- make \
103
- libtool \
104
- autoconf \
105
- automake-wrapper
106
- ```
107
-
108
- 3. **Apple Mobile Device Support** (for USB communication)
109
- - Either install iTunes from [https://www.apple.com/itunes/](https://www.apple.com/itunes/)
110
- - Or install just "Apple Mobile Device Support" from the iTunes installer
111
-
112
- #### How It Works
113
-
114
- On Windows, building libimobiledevice from source is required. The script:
115
- 1. Generates a `build-windows.sh` script in the target directory
116
- 2. The build script downloads the official libimobiledevice build script
117
- 3. Compiles all required libraries and tools from source
118
- 4. Copies the resulting binaries and DLLs to the target directory
119
-
120
- #### Running
121
-
122
- **Step 1:** Generate the build script (can be done on any platform):
123
- ```bash
124
- cd scripts/export-apple-resources
125
- npx tsx export-resources.ts /path/to/output
126
- ```
127
-
128
- **Step 2:** Open **MSYS2 MinGW 64-bit** shell (NOT regular MSYS2 shell!)
129
- - Find it in Start Menu: "MSYS2 MinGW 64-bit"
130
-
131
- **Step 3:** Run the build script:
132
- ```bash
133
- cd /path/to/output
134
- bash build-windows.sh
135
- ```
136
-
137
- > **Note:** The build process may take 10-30 minutes depending on your system.
138
-
139
- #### Troubleshooting Windows Build
140
-
141
- | Issue | Solution |
142
- |-------|----------|
143
- | "gcc not found" | Install packages: `pacman -S mingw-w64-x86_64-gcc` |
144
- | "This script must be run from MSYS2 MinGW 64-bit shell" | Open the correct shell from Start Menu |
145
- | Build fails with SSL errors | `pacman -S mingw-w64-x86_64-openssl` |
146
- | Device not detected | Ensure iTunes or Apple Mobile Device Support is installed |
147
-
148
- ---
149
-
150
- ## Tools Included
151
-
152
- ### Required Tools (must be present)
153
- | Tool | Description |
154
- |------|-------------|
155
- | `idevice_id` | List connected iOS devices |
156
- | `ideviceinfo` | Get device information |
157
- | `idevicepair` | Manage device pairing/trust |
158
- | `idevicename` | Get/set device name |
159
- | `idevicedebug` | Debug applications |
160
- | `ideviceinstaller` | Install/uninstall apps |
161
- | `iproxy` | Port forwarding |
162
-
163
- ### Optional Tools (copied if available)
164
- | Tool | Description |
165
- |------|-------------|
166
- | `ideviceactivation` | Device activation |
167
- | `idevicesyslog` | View device system log |
168
- | `idevicescreenshot` | Take screenshots |
169
- | `idevicediagnostics` | Device diagnostics |
170
-
171
- ---
172
-
173
- ## Integrating with Your Application
174
-
175
- After exporting resources, configure `apple-kit` to use them:
176
-
177
- ### Option 1: Environment Variable
178
-
179
- Set `IDeviceBinPath` to point to the bin directory:
180
-
181
- ```bash
182
- # macOS
183
- export IDeviceBinPath=/path/to/resources/bin/darwin
184
-
185
- # Windows (PowerShell)
186
- $env:IDeviceBinPath = "C:\path\to\resources\bin\windows"
187
- ```
188
-
189
- ### Option 2: Bundle with Your App
190
-
191
- Copy the exported resources into your application's resources folder. The `apple-kit` package will automatically detect binaries in:
192
- - `<your-app>/resources/bin/darwin/` (macOS)
193
- - `<your-app>/resources/bin/windows/` (Windows)
194
-
195
- ---
196
-
197
- ## License
198
-
199
- The libimobiledevice tools are licensed under **LGPL-2.1**. When distributing these binaries, you must:
200
- 1. Include the LGPL-2.1 license (automatically included in `licenses/` folder)
201
- 2. Provide access to the source code (links included in the license file)
202
-
203
- Source code repositories:
204
- - https://github.com/libimobiledevice/libimobiledevice
205
- - https://github.com/libimobiledevice/libusbmuxd
206
- - https://github.com/libimobiledevice/libplist
207
- - https://github.com/libimobiledevice/libimobiledevice-glue
208
- - https://github.com/libimobiledevice/ideviceinstaller
209
-
1
+ # Export Apple Resources Script
2
+
3
+ This script exports libimobiledevice binaries and their dependencies to a specified target directory. The exported resources can be used by applications that depend on `@mcesystems/apple-kit`.
4
+
5
+ ## Usage
6
+
7
+ After installing `@mcesystems/apple-kit`:
8
+
9
+ ```bash
10
+ # Using the binary (recommended)
11
+ npx export-apple-resources <target-path>
12
+
13
+ # Or run the script directly with tsx
14
+ npx tsx node_modules/@mcesystems/apple-kit/scripts/export-resources.ts <target-path>
15
+ ```
16
+
17
+ ### Examples
18
+
19
+ ```bash
20
+ # Export to a relative path
21
+ npx tsx export-resources.ts ./my-app/resources/apple-kit
22
+
23
+ # Export to an absolute path
24
+ npx tsx export-resources.ts /Users/me/projects/my-app/resources
25
+ ```
26
+
27
+ ### Output Structure
28
+
29
+ The script creates the following directory structure:
30
+
31
+ ```
32
+ <target-path>/
33
+ ├── bin/
34
+ │ ├── darwin/ # macOS binaries and dylibs
35
+ │ │ ├── idevice_id
36
+ │ │ ├── ideviceinfo
37
+ │ │ ├── iproxy
38
+ │ │ ├── libimobiledevice-1.0.6.dylib
39
+ │ │ └── ... (other tools and dylibs)
40
+ │ └── windows/ # Windows binaries and DLLs
41
+ │ ├── idevice_id.exe
42
+ │ ├── ideviceinfo.exe
43
+ │ ├── iproxy.exe
44
+ │ ├── libimobiledevice-1.0-6.dll
45
+ │ └── ... (other tools and DLLs)
46
+ ├── licenses/
47
+ │ └── LGPL-2.1.txt
48
+ └── build-windows.sh # Windows build script (generated on non-Windows)
49
+ ```
50
+
51
+ ---
52
+
53
+ ## Platform-Specific Prerequisites
54
+
55
+ ### macOS
56
+
57
+ #### Prerequisites
58
+
59
+ 1. **Homebrew** installed ([https://brew.sh](https://brew.sh))
60
+
61
+ 2. **libimobiledevice tools** installed via Homebrew:
62
+ ```bash
63
+ brew install libimobiledevice ideviceinstaller
64
+ ```
65
+
66
+ 3. **Node.js 18+** with `tsx` available:
67
+ ```bash
68
+ npm install -g tsx
69
+ # or use npx
70
+ ```
71
+
72
+ #### How It Works
73
+
74
+ On macOS, the script:
75
+ 1. Locates Homebrew installation (`/opt/homebrew` for Apple Silicon, `/usr/local` for Intel)
76
+ 2. Copies required binaries (`idevice_id`, `ideviceinfo`, `iproxy`, etc.)
77
+ 3. Recursively collects all dylib dependencies
78
+ 4. Fixes dylib paths using `install_name_tool` to use `@loader_path` (makes binaries portable)
79
+
80
+ #### Running
81
+
82
+ ```bash
83
+ cd scripts/export-apple-resources
84
+ npx tsx export-resources.ts /path/to/output
85
+ ```
86
+
87
+ ---
88
+
89
+ ### Windows
90
+
91
+ #### Prerequisites
92
+
93
+ 1. **MSYS2** installed from [https://www.msys2.org](https://www.msys2.org)
94
+ - Download and run the installer
95
+ - Default installation path: `C:\msys64`
96
+
97
+ 2. **Required MSYS2 packages** - Open **MSYS2 MinGW 64-bit** shell and run:
98
+ ```bash
99
+ pacman -S base-devel \
100
+ git \
101
+ mingw-w64-x86_64-gcc \
102
+ make \
103
+ libtool \
104
+ autoconf \
105
+ automake-wrapper
106
+ ```
107
+
108
+ 3. **Apple Mobile Device Support** (for USB communication)
109
+ - Either install iTunes from [https://www.apple.com/itunes/](https://www.apple.com/itunes/)
110
+ - Or install just "Apple Mobile Device Support" from the iTunes installer
111
+
112
+ #### How It Works
113
+
114
+ On Windows, building libimobiledevice from source is required. The script:
115
+ 1. Generates a `build-windows.sh` script in the target directory
116
+ 2. The build script downloads the official libimobiledevice build script
117
+ 3. Compiles all required libraries and tools from source
118
+ 4. Copies the resulting binaries and DLLs to the target directory
119
+
120
+ #### Running
121
+
122
+ **Step 1:** Generate the build script (can be done on any platform):
123
+ ```bash
124
+ cd scripts/export-apple-resources
125
+ npx tsx export-resources.ts /path/to/output
126
+ ```
127
+
128
+ **Step 2:** Open **MSYS2 MinGW 64-bit** shell (NOT regular MSYS2 shell!)
129
+ - Find it in Start Menu: "MSYS2 MinGW 64-bit"
130
+
131
+ **Step 3:** Run the build script:
132
+ ```bash
133
+ cd /path/to/output
134
+ bash build-windows.sh
135
+ ```
136
+
137
+ > **Note:** The build process may take 10-30 minutes depending on your system.
138
+
139
+ #### Troubleshooting Windows Build
140
+
141
+ | Issue | Solution |
142
+ |-------|----------|
143
+ | "gcc not found" | Install packages: `pacman -S mingw-w64-x86_64-gcc` |
144
+ | "This script must be run from MSYS2 MinGW 64-bit shell" | Open the correct shell from Start Menu |
145
+ | Build fails with SSL errors | `pacman -S mingw-w64-x86_64-openssl` |
146
+ | Device not detected | Ensure iTunes or Apple Mobile Device Support is installed |
147
+
148
+ ---
149
+
150
+ ## Tools Included
151
+
152
+ ### Required Tools (must be present)
153
+ | Tool | Description |
154
+ |------|-------------|
155
+ | `idevice_id` | List connected iOS devices |
156
+ | `ideviceinfo` | Get device information |
157
+ | `idevicepair` | Manage device pairing/trust |
158
+ | `idevicename` | Get/set device name |
159
+ | `idevicedebug` | Debug applications |
160
+ | `ideviceinstaller` | Install/uninstall apps |
161
+ | `iproxy` | Port forwarding |
162
+
163
+ ### Optional Tools (copied if available)
164
+ | Tool | Description |
165
+ |------|-------------|
166
+ | `ideviceactivation` | Device activation |
167
+ | `idevicesyslog` | View device system log |
168
+ | `idevicescreenshot` | Take screenshots |
169
+ | `idevicediagnostics` | Device diagnostics |
170
+
171
+ ---
172
+
173
+ ## Integrating with Your Application
174
+
175
+ After exporting resources, configure `apple-kit` to use them:
176
+
177
+ ### Option 1: Environment Variable
178
+
179
+ Set `IDeviceBinPath` to point to the bin directory:
180
+
181
+ ```bash
182
+ # macOS
183
+ export IDeviceBinPath=/path/to/resources/bin/darwin
184
+
185
+ # Windows (PowerShell)
186
+ $env:IDeviceBinPath = "C:\path\to\resources\bin\windows"
187
+ ```
188
+
189
+ ### Option 2: Bundle with Your App
190
+
191
+ Copy the exported resources into your application's resources folder. The `apple-kit` package will automatically detect binaries in:
192
+ - `<your-app>/resources/bin/darwin/` (macOS)
193
+ - `<your-app>/resources/bin/windows/` (Windows)
194
+
195
+ ---
196
+
197
+ ## License
198
+
199
+ The libimobiledevice tools are licensed under **LGPL-2.1**. When distributing these binaries, you must:
200
+ 1. Include the LGPL-2.1 license (automatically included in `licenses/` folder)
201
+ 2. Provide access to the source code (links included in the license file)
202
+
203
+ Source code repositories:
204
+ - https://github.com/libimobiledevice/libimobiledevice
205
+ - https://github.com/libimobiledevice/libusbmuxd
206
+ - https://github.com/libimobiledevice/libplist
207
+ - https://github.com/libimobiledevice/libimobiledevice-glue
208
+ - https://github.com/libimobiledevice/ideviceinstaller
209
+