@mobilenext/mobilecli 0.0.51 → 0.0.53

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 CHANGED
@@ -26,7 +26,6 @@ A universal command-line tool for managing iOS and Android devices, simulators,
26
26
  </a>
27
27
  </p>
28
28
 
29
-
30
29
  ## Features 🚀
31
30
 
32
31
  - **Device Management**: List, manage, interactive with connected mobile devices
@@ -34,9 +33,9 @@ A universal command-line tool for managing iOS and Android devices, simulators,
34
33
  - **Emulator/Simulator Control**: Boot and shutdown emulators and simulators programmatically
35
34
  - **Screenshot Capture**: Take screenshots from any connected device with format options
36
35
  - **Multiple Output Formats**: Save screenshots as PNG or JPEG with quality control
37
- - **Screencapture video streaming**: Stream mjpeg video directly from device
36
+ - **Screencapture video streaming**: Stream mjpeg/h264 video directly from device
38
37
  - **Device Control**: Reboot devices, tap screen coordinates, press hardware buttons
39
- - **App management**: Launch app, terminate apps. Install and uninstall coming next ⏭️
38
+ - **App Management**: Launch app, terminate apps, install and uninstall
40
39
 
41
40
  ## Installation 📦
42
41
 
@@ -178,6 +177,36 @@ mobilecli io text --device <device-id> 'hello world'
178
177
  - `VOLUME_UP`, `VOLUME_DOWN` - Volume up and down
179
178
  - `DPAD_UP`, `DPAD_DOWN`, `DPAD_LEFT`, `DPAD_RIGHT`, `DPAD_CENTER` - D-pad controls (Android only)
180
179
 
180
+ ## HTTP API 🔌
181
+
182
+ ***mobilecli*** provides an http interface for all the functionality that is available through command line. As a matter of fact, it is preferable to
183
+ use mobilecli as a webserver, so it can cache and keep tunnels alive, speeding up your interactions with the mobile device or simulator/emulator.
184
+
185
+ ```bash
186
+ # Start the server (default port 12000)
187
+ mobile server start
188
+
189
+ curl http://localhost:12000/rpc -XPOST -d '{"jsonrpc":"2.0", "id": 1, "method": "devices", "params": {}}'
190
+ curl http://localhost:12000/rpc -XPOST -d '{"jsonrpc":"2.0", "id": 1, "method": "screenshot", "params": {"deviceId": "your-device-id"}}'
191
+
192
+ ## WebSocket Support 🔌
193
+
194
+ ***mobilecli*** includes a WebSocket server that allows multiple requests over a single connection using the same JSON-RPC 2.0 format as the HTTP API.
195
+
196
+ ```bash
197
+ # Start the server (default port 12000)
198
+ mobilecli server start
199
+
200
+ # Connect and send requests using wscat
201
+ wscat -c ws://localhost:12000/ws
202
+ > {"jsonrpc":"2.0","id":1,"method":"devices","params":{}}
203
+ < {"jsonrpc":"2.0","id":1,"result":[...]}
204
+ > {"jsonrpc":"2.0","id":2,"method":"screenshot","params":{"deviceId":"your-device-id"}}
205
+ < {"jsonrpc":"2.0","id":2,"result":{...}}
206
+ ```
207
+
208
+ **Note**: `screencapture` is not supported over WebSocket - use the HTTP `/rpc` endpoint for video streaming.
209
+
181
210
  ## Platform-Specific Notes
182
211
 
183
212
  ### iOS Real Devices
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mobilenext/mobilecli",
3
- "version": "0.0.51",
3
+ "version": "0.0.53",
4
4
  "author": "Mobile Next",
5
5
  "description": "A universal command-line tool for managing iOS and Android devices, simulators, emulators and apps",
6
6
  "repository": {