mobilecli 1.0.4 → 1.0.6
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/README.md +85 -1
- package/bin/mobilecli-darwin-amd64 +0 -0
- package/bin/mobilecli-darwin-arm64 +0 -0
- package/bin/mobilecli-linux-amd64 +0 -0
- package/bin/mobilecli-linux-arm64 +0 -0
- package/bin/mobilecli-windows-amd64.exe +0 -0
- package/bin/mobilecli-windows-arm64.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,9 +35,11 @@ A universal command-line tool for managing iOS and Android devices, simulators,
|
|
|
35
35
|
- **Multiple Output Formats**: Save screenshots as PNG or JPEG with quality control
|
|
36
36
|
- **Screencapture video streaming**: Stream mjpeg/h264 video directly from device
|
|
37
37
|
- **Device Control**: Reboot devices, tap screen coordinates, press hardware buttons
|
|
38
|
-
- **App Management**: Launch, terminate, install, uninstall, list, and get foreground apps
|
|
38
|
+
- **App Management**: Launch, terminate, install, uninstall, clear data, list, and get foreground apps
|
|
39
39
|
- **Filesystem**: Push, pull, list, mkdir, and rm files on-device or in app containers (Android, iOS Simulator)
|
|
40
|
+
- **Location Override**: Fake the GPS location reported by a device
|
|
40
41
|
- **Crash Reports**: List and fetch crash reports from iOS and Android devices
|
|
42
|
+
- **Device Logs**: Stream real-time device logs with filtering from iOS and Android devices
|
|
41
43
|
- **Webview Inspection**: List, navigate, query DOM, and evaluate JavaScript in embedded webviews
|
|
42
44
|
|
|
43
45
|
### 🎯 Platform Support
|
|
@@ -138,6 +140,12 @@ mobilecli screenshot --device <device-id>
|
|
|
138
140
|
# Take a JPEG screenshot with custom quality
|
|
139
141
|
mobilecli screenshot --device <device-id> --format jpeg --quality 80
|
|
140
142
|
|
|
143
|
+
# Scale the screenshot down to half size
|
|
144
|
+
mobilecli screenshot --device <device-id> --scale 0.5
|
|
145
|
+
|
|
146
|
+
# Limit the largest dimension to 800 pixels, keeping aspect ratio
|
|
147
|
+
mobilecli screenshot --device <device-id> --max-size 800
|
|
148
|
+
|
|
141
149
|
# Save to specific path
|
|
142
150
|
mobilecli screenshot --device <device-id> --output screenshot.png
|
|
143
151
|
|
|
@@ -179,8 +187,39 @@ mobilecli io button --device <device-id> POWER
|
|
|
179
187
|
|
|
180
188
|
# Send text
|
|
181
189
|
mobilecli io text --device <device-id> 'hello world'
|
|
190
|
+
|
|
191
|
+
# Read device clipboard
|
|
192
|
+
mobilecli io clipboard get --device <device-id>
|
|
193
|
+
|
|
194
|
+
# Write device clipboard
|
|
195
|
+
mobilecli io clipboard set --device <device-id> 'hello world'
|
|
196
|
+
|
|
197
|
+
# Send keys combination to paste (cmd+v for iOS, ctrl+v for Android)
|
|
198
|
+
mobilecli io keys --device <device-id> "cmd+v"
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Location Override 📍
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
# Fake the device location (latitude,longitude)
|
|
205
|
+
mobilecli device location set --device <device-id> 37.7749,-122.4194
|
|
206
|
+
|
|
207
|
+
# Hold the override until Ctrl-C, then clear it automatically
|
|
208
|
+
mobilecli device location set --device <device-id> 37.7749,-122.4194 --wait
|
|
209
|
+
|
|
210
|
+
# Restore the real location
|
|
211
|
+
mobilecli device location clear --device <device-id>
|
|
182
212
|
```
|
|
183
213
|
|
|
214
|
+
Caveats per platform:
|
|
215
|
+
|
|
216
|
+
| Platform | Notes |
|
|
217
|
+
|----------|-------|
|
|
218
|
+
| iOS Simulator | Works out of the box, the override survives mobilecli exiting |
|
|
219
|
+
| iOS Real Device | The override only lives as long as the mobilecli process that set it, so `--wait` is required. `clear` has to come from that same process |
|
|
220
|
+
| Android Emulator | Uses the emulator console. It has no way to undo a fix, so `clear` sets the location back to the coordinates an emulator boots with (the Googleplex), not to a real one |
|
|
221
|
+
| Android Real Device | Runs an on-device agent as a mock location provider, granting the `mock_location` appop to `com.android.shell`. Some OEM ROMs ignore mock providers, and apps checking `Location.isFromMockProvider()` or Play Integrity can tell |
|
|
222
|
+
|
|
184
223
|
### Supported Hardware Buttons
|
|
185
224
|
|
|
186
225
|
- `HOME` - Home button
|
|
@@ -209,6 +248,10 @@ mobilecli apps install <path> --device <device-id>
|
|
|
209
248
|
|
|
210
249
|
# Uninstall an app
|
|
211
250
|
mobilecli apps uninstall <bundle-id> --device <device-id>
|
|
251
|
+
|
|
252
|
+
# Clear app data (cache, preferences, databases) without uninstalling
|
|
253
|
+
# Supported on Android and iOS Simulator
|
|
254
|
+
mobilecli apps clear <bundle-id> --device <device-id>
|
|
212
255
|
```
|
|
213
256
|
|
|
214
257
|
Example output for `apps foreground`:
|
|
@@ -425,6 +468,47 @@ Example output for `crashes list`:
|
|
|
425
468
|
|
|
426
469
|
**Note**: On iOS real devices, crash reports are fetched via the Apple crashreport service. On iOS simulators, they are read from `~/Library/Logs/DiagnosticReports/`. On Android, crashes are parsed from `adb logcat -b crash`.
|
|
427
470
|
|
|
471
|
+
### Device Logs 📋
|
|
472
|
+
|
|
473
|
+
```bash
|
|
474
|
+
# Stream logs from a device (Ctrl+C to stop)
|
|
475
|
+
mobilecli device logs --device <device-id>
|
|
476
|
+
|
|
477
|
+
# Stop after 100 entries
|
|
478
|
+
mobilecli device logs --device <device-id> --limit 100
|
|
479
|
+
|
|
480
|
+
# Filter by field (exact match)
|
|
481
|
+
mobilecli device logs --filter process=SpringBoard
|
|
482
|
+
mobilecli device logs --filter tag=ActivityManager
|
|
483
|
+
|
|
484
|
+
# Exclude by field
|
|
485
|
+
mobilecli device logs --filter process!=SpringBoard
|
|
486
|
+
|
|
487
|
+
# Combine filters (AND logic)
|
|
488
|
+
mobilecli device logs --filter level=Error --filter process!=SpringBoard
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
Supported filter keys: `pid`, `process`, `tag`, `level`, `subsystem`, `category`, `message`
|
|
492
|
+
|
|
493
|
+
Each log entry is printed as a JSON line:
|
|
494
|
+
```json
|
|
495
|
+
{"timestamp":"2026-04-15 12:17:14.224451+0300","message":"Start proc...","level":"Default","subsystem":"com.apple.UIKit","category":"EventDispatch","pid":54052,"process":"SpringBoard"}
|
|
496
|
+
```
|
|
497
|
+
|
|
498
|
+
Logs are also available over the [HTTP API](#http-api-) via the `device.logs` method, which takes the same `limit` and `filters` and returns a URL to stream from:
|
|
499
|
+
|
|
500
|
+
```bash
|
|
501
|
+
curl -X POST http://localhost:12000/rpc -H "Content-Type: application/json" -d '{
|
|
502
|
+
"jsonrpc": "2.0", "method": "device.logs", "id": 1,
|
|
503
|
+
"params": { "deviceId": "<device-id>", "limit": 100, "filters": ["level=Error", "process!=SpringBoard"] }
|
|
504
|
+
}'
|
|
505
|
+
# => {"jsonrpc":"2.0","id":1,"result":{"sessionUrl":"/sessions/<session-id>/logs"}}
|
|
506
|
+
|
|
507
|
+
curl -N http://localhost:12000/sessions/<session-id>/logs
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
The session expires one minute after creation and accepts a single connection. Disconnecting stops the log stream on the device.
|
|
511
|
+
|
|
428
512
|
### Remote Devices ☁️
|
|
429
513
|
|
|
430
514
|
```bash
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|