mobilecli 1.0.6 → 1.0.8
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 +21 -13
- package/index.js +23 -9
- package/package.json +9 -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/README.md
CHANGED
|
@@ -2,25 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
A universal command-line tool for managing iOS and Android devices, simulators, emulators and apps from [Mobile Next](https://github.com/mobile-next/).
|
|
4
4
|
|
|
5
|
-
<p align="
|
|
5
|
+
<p align="left">
|
|
6
6
|
<a href="https://github.com/mobile-next/mobilecli">
|
|
7
7
|
<img src="https://img.shields.io/github/stars/mobile-next/mobilecli" alt="Mobile Next Stars" />
|
|
8
8
|
</a>
|
|
9
|
-
<a href="https://github.com/mobile-next/mobilecli">
|
|
10
|
-
<img src="https://img.shields.io/github/contributors/mobile-next/mobilecli?color=green" alt="Mobile Next Downloads" />
|
|
11
|
-
</a>
|
|
12
9
|
<a href="https://www.npmjs.com/package/mobilecli">
|
|
13
10
|
<img src="https://img.shields.io/npm/dm/mobilecli?logo=npm&style=flat&color=red" alt="npm">
|
|
14
11
|
</a>
|
|
15
|
-
<a href="https://github.com/mobile-next/mobilecli/releases">
|
|
16
|
-
<img src="https://img.shields.io/github/release/mobile-next/mobilecli">
|
|
17
|
-
</a>
|
|
18
12
|
<a href="https://github.com/mobile-next/mobilecli/blob/main/LICENSE">
|
|
19
13
|
<img src="https://img.shields.io/badge/license-FSL--1.1--Apache--2.0-blue.svg" alt="mobilecli is released under the FSL-1.1-Apache-2.0 License">
|
|
20
14
|
</a>
|
|
21
|
-
</p>
|
|
22
|
-
|
|
23
|
-
<p align="center">
|
|
24
15
|
<a href="http://mobilenext.ai/join-slack">
|
|
25
16
|
<img src="https://img.shields.io/badge/join-Slack-blueviolet?logo=slack&style=flat" alt="Slack community channel" />
|
|
26
17
|
</a>
|
|
@@ -146,6 +137,9 @@ mobilecli screenshot --device <device-id> --scale 0.5
|
|
|
146
137
|
# Limit the largest dimension to 800 pixels, keeping aspect ratio
|
|
147
138
|
mobilecli screenshot --device <device-id> --max-size 800
|
|
148
139
|
|
|
140
|
+
# Crop to a region (x,y,width,height in screen points), applied before scaling
|
|
141
|
+
mobilecli screenshot --device <device-id> --clip 10,80,300,200
|
|
142
|
+
|
|
149
143
|
# Save to specific path
|
|
150
144
|
mobilecli screenshot --device <device-id> --output screenshot.png
|
|
151
145
|
|
|
@@ -352,7 +346,7 @@ Example output for `fs ls`:
|
|
|
352
346
|
|
|
353
347
|
On **iOS**, the on-device agent is required for touch input (taps, swipes, button presses), screen capture streaming, and UI tree inspection. These capabilities are not available through standard iOS tooling without an agent running on the device.
|
|
354
348
|
|
|
355
|
-
On **Android**,
|
|
349
|
+
On **Android**, no agent is needed. Running `mobilecli agent status` on an Android device simply reports that.
|
|
356
350
|
|
|
357
351
|
```bash
|
|
358
352
|
# Check if the agent is installed on a device
|
|
@@ -541,10 +535,24 @@ npx skills add mobile-next/mobilecli -g
|
|
|
541
535
|
|
|
542
536
|
Then ask your agent things like "take a screenshot of my emulator" or "tap the login button" — the skill triggers automatically.
|
|
543
537
|
|
|
538
|
+
## Daemon ⚙️
|
|
539
|
+
|
|
540
|
+
Every device command talks to a per-user background daemon that keeps discovered devices, iOS tunnels and on-device agents alive between invocations, so only the first command pays the discovery cost. The daemon starts automatically on the first device command (`mobilecli --help` and `--version` never start it) and exits after 30 minutes without requests.
|
|
541
|
+
|
|
542
|
+
```bash
|
|
543
|
+
# Inspect or control it explicitly
|
|
544
|
+
mobilecli daemon status
|
|
545
|
+
mobilecli daemon stop
|
|
546
|
+
|
|
547
|
+
# Run it in the foreground (e.g. under a service manager), with a custom idle timeout
|
|
548
|
+
mobilecli daemon start --idle-timeout 0
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
The CLI and daemon talk JSON-RPC over a unix domain socket in `~/.mobilecli/` (override with `MOBILECLI_HOME`); the daemon's log is `~/.mobilecli/daemon.log`. A daemon left over from an older mobilecli version is restarted automatically. `auth login` and `auth logout` stop a running daemon so it picks up the new credentials.
|
|
552
|
+
|
|
544
553
|
## HTTP API 🔌
|
|
545
554
|
|
|
546
|
-
***mobilecli*** provides an http interface for all the functionality that is available through command line.
|
|
547
|
-
use mobilecli as a webserver, so it can cache and keep tunnels alive, speeding up your interactions with the mobile device or simulator/emulator.
|
|
555
|
+
***mobilecli*** provides an http interface for all the functionality that is available through command line. The server is a thin front for the daemon above, so HTTP clients and the CLI share one set of devices and tunnels.
|
|
548
556
|
|
|
549
557
|
For the full list of available JSON-RPC methods and their parameters, see the [OpenRPC specification](https://github.com/mobile-next/mobile-openrpc/blob/main/mobilecli/openrpc.md).
|
|
550
558
|
|
package/index.js
CHANGED
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
const { join } = require("node:path");
|
|
4
4
|
const { spawn } = require("node:child_process");
|
|
5
5
|
|
|
6
|
-
let
|
|
6
|
+
let packageName;
|
|
7
|
+
let binaryName;
|
|
7
8
|
|
|
8
9
|
switch (process.platform) {
|
|
9
10
|
case "darwin":
|
|
10
11
|
switch (process.arch) {
|
|
11
12
|
case "arm64":
|
|
12
|
-
|
|
13
|
+
packageName = "@mobilenext/mobilecli-darwin-arm64";
|
|
14
|
+
binaryName = "mobilecli-darwin-arm64";
|
|
13
15
|
break;
|
|
14
16
|
case "x64":
|
|
15
|
-
|
|
17
|
+
packageName = "@mobilenext/mobilecli-darwin-amd64";
|
|
18
|
+
binaryName = "mobilecli-darwin-amd64";
|
|
16
19
|
break;
|
|
17
20
|
}
|
|
18
21
|
break;
|
|
@@ -20,10 +23,12 @@ switch (process.platform) {
|
|
|
20
23
|
case "linux":
|
|
21
24
|
switch (process.arch) {
|
|
22
25
|
case "arm64":
|
|
23
|
-
|
|
26
|
+
packageName = "@mobilenext/mobilecli-linux-arm64";
|
|
27
|
+
binaryName = "mobilecli-linux-arm64";
|
|
24
28
|
break;
|
|
25
29
|
case "x64":
|
|
26
|
-
|
|
30
|
+
packageName = "@mobilenext/mobilecli-linux-amd64";
|
|
31
|
+
binaryName = "mobilecli-linux-amd64";
|
|
27
32
|
break;
|
|
28
33
|
}
|
|
29
34
|
break;
|
|
@@ -31,21 +36,30 @@ switch (process.platform) {
|
|
|
31
36
|
case "win32":
|
|
32
37
|
switch (process.arch) {
|
|
33
38
|
case "arm64":
|
|
34
|
-
|
|
39
|
+
packageName = "@mobilenext/mobilecli-windows-arm64";
|
|
40
|
+
binaryName = "mobilecli-windows-arm64.exe";
|
|
35
41
|
break;
|
|
36
42
|
case "x64":
|
|
37
|
-
|
|
43
|
+
packageName = "@mobilenext/mobilecli-windows-amd64";
|
|
44
|
+
binaryName = "mobilecli-windows-amd64.exe";
|
|
38
45
|
break;
|
|
39
46
|
}
|
|
40
47
|
break;
|
|
41
48
|
}
|
|
42
49
|
|
|
43
|
-
if (!
|
|
50
|
+
if (!packageName) {
|
|
44
51
|
console.error(`Unsupported platform: ${process.platform}-${process.arch}`);
|
|
45
52
|
process.exit(1);
|
|
46
53
|
}
|
|
47
54
|
|
|
48
|
-
|
|
55
|
+
let binaryPath;
|
|
56
|
+
try {
|
|
57
|
+
const packagePath = require.resolve(`${packageName}/package.json`);
|
|
58
|
+
binaryPath = join(packagePath, "..", binaryName);
|
|
59
|
+
} catch (error) {
|
|
60
|
+
console.error(`Failed to find ${packageName}. Please reinstall @mobilenext/mobilecli.`);
|
|
61
|
+
process.exit(1);
|
|
62
|
+
}
|
|
49
63
|
|
|
50
64
|
const args = process.argv.slice(2);
|
|
51
65
|
const child = spawn(binaryPath, args, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mobilecli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
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": {
|
|
@@ -10,5 +10,13 @@
|
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"bin": {
|
|
12
12
|
"mobilecli": "index.js"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@mobilenext/mobilecli-darwin-amd64": "1.0.8",
|
|
16
|
+
"@mobilenext/mobilecli-darwin-arm64": "1.0.8",
|
|
17
|
+
"@mobilenext/mobilecli-linux-amd64": "1.0.8",
|
|
18
|
+
"@mobilenext/mobilecli-linux-arm64": "1.0.8",
|
|
19
|
+
"@mobilenext/mobilecli-windows-amd64": "1.0.8",
|
|
20
|
+
"@mobilenext/mobilecli-windows-arm64": "1.0.8"
|
|
13
21
|
}
|
|
14
22
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|