@mobilenext/mobilecli 0.0.20 → 0.0.22
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 +180 -0
- package/bin/mobilecli-darwin +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/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# mobilecli
|
|
2
|
+
|
|
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
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<a href="https://github.com/mobile-next/mobilecli">
|
|
7
|
+
<img src="https://img.shields.io/github/stars/mobile-next/mobilecli" alt="Mobile Next Stars" />
|
|
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
|
+
<a href="https://www.npmjs.com/package/@mobilenext/mobilecli">
|
|
13
|
+
<img src="https://img.shields.io/npm/dm/@mobilenext/mobilecli?logo=npm&style=flat&color=red" alt="npm">
|
|
14
|
+
</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
|
+
<a href="https://github.com/mobile-next/mobilecli/blob/main/LICENSE">
|
|
19
|
+
<img src="https://img.shields.io/badge/license-AGPL v3.0-blue.svg" alt="Mobile MCP is released under the AGPL v3.0 License">
|
|
20
|
+
</a>
|
|
21
|
+
</p>
|
|
22
|
+
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="http://mobilenexthq.com/join-slack">
|
|
25
|
+
<img src="https://img.shields.io/badge/join-Slack-blueviolet?logo=slack&style=flat" alt="Slack community channel" />
|
|
26
|
+
</a>
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## Features 🚀
|
|
31
|
+
|
|
32
|
+
- **Device Management**: List, manage, interactive with connected mobile devices
|
|
33
|
+
- **Cross-Platform Support**: Works with iOS physical devices, iOS simulators, Android devices, and Android emulators
|
|
34
|
+
- **Screenshot Capture**: Take screenshots from any connected device with format options
|
|
35
|
+
- **Multiple Output Formats**: Save screenshots as PNG or JPEG with quality control
|
|
36
|
+
- **Screencapture video streaming**: Stream mjpeg video directly from device
|
|
37
|
+
- **Device Control**: Reboot devices, tap screen coordinates, press hardware buttons
|
|
38
|
+
- **App management**: Launch app, terminate apps. Install and uninstall coming next ⏭️
|
|
39
|
+
|
|
40
|
+
## Installation 📦
|
|
41
|
+
|
|
42
|
+
#### Prerequisites 📋
|
|
43
|
+
- **Android SDK** with `adb` in PATH (for Android device support)
|
|
44
|
+
- **Xcode Command Line Tools** (for iOS simulator support on macOS)
|
|
45
|
+
|
|
46
|
+
#### Run instantly with npx
|
|
47
|
+
```bash
|
|
48
|
+
npx @mobilenext/mobilecli@latest
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
#### Install globally with npm
|
|
52
|
+
```bash
|
|
53
|
+
npm install -g @mobilenext/mobilecli@latest
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Install from Source 🛠️
|
|
57
|
+
```bash
|
|
58
|
+
git clone https://github.com/mobile-next/mobilecli.git
|
|
59
|
+
cd mobilecli
|
|
60
|
+
make build
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Install Dependencies
|
|
64
|
+
|
|
65
|
+
#### 🍎 For iOS Simulator Support
|
|
66
|
+
|
|
67
|
+
Xcode is required. Make sure you have it installed with the runtimes relevant for you installed. You will have to create Simulators and have them booted before `mobilecli` can use them.
|
|
68
|
+
|
|
69
|
+
`mobilecli` will automatically install an agent on the device that is required for functionalities such as opening a url, tapping on buttons and streaming screen capture.
|
|
70
|
+
|
|
71
|
+
#### 🤖 For Android Support
|
|
72
|
+
```bash
|
|
73
|
+
# Install Android SDK and ensure adb is in PATH
|
|
74
|
+
# Download from: https://developer.android.com/studio/command-line/adb
|
|
75
|
+
# or
|
|
76
|
+
brew install --cask android-platform-tools
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Usage
|
|
80
|
+
|
|
81
|
+
### List Connected Devices 🔍
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
# List all connected devices and simulators to your local or remote server
|
|
85
|
+
mobilecli devices
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Example output:
|
|
89
|
+
```json
|
|
90
|
+
[
|
|
91
|
+
{
|
|
92
|
+
"id": "12345678-1234567890ABCDEF",
|
|
93
|
+
"name": "iPhone 15",
|
|
94
|
+
"platform": "ios",
|
|
95
|
+
"type": "real"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"id": "emulator-5554",
|
|
99
|
+
"name": "Pixel_7_API_34",
|
|
100
|
+
"platform": "android",
|
|
101
|
+
"type": "emulator"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Take Screenshots 📸
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
# Take a PNG screenshot (default)
|
|
110
|
+
mobilecli screenshot --device <device-id>
|
|
111
|
+
|
|
112
|
+
# Take a JPEG screenshot with custom quality
|
|
113
|
+
mobilecli screenshot --device <device-id> --format jpeg --quality 80
|
|
114
|
+
|
|
115
|
+
# Save to specific path
|
|
116
|
+
mobilecli screenshot --device <device-id> --output screenshot.png
|
|
117
|
+
|
|
118
|
+
# Output to stdout
|
|
119
|
+
mobilecli screenshot --device <device-id> --output -
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### Stream Screen 🎥
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
mobilecli screencapture --device <device-id> --format mjpeg | ffplay -
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Note that screencapture is one way. You will have to use `io tap` commands to tap on the screen.
|
|
129
|
+
|
|
130
|
+
### Device Control 🎮
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
# Reboot a device
|
|
134
|
+
mobilecli device reboot --device <device-id>
|
|
135
|
+
|
|
136
|
+
# Tap at coordinates (x,y)
|
|
137
|
+
mobilecli io tap --device <device-id> 100,200
|
|
138
|
+
|
|
139
|
+
# Press hardware buttons
|
|
140
|
+
mobilecli io button --device <device-id> HOME
|
|
141
|
+
mobilecli io button --device <device-id> VOLUME_UP
|
|
142
|
+
mobilecli io button --device <device-id> POWER
|
|
143
|
+
|
|
144
|
+
# Send text
|
|
145
|
+
mobilecli io text --device <device-id> 'hello world'
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Supported Hardware Buttons
|
|
149
|
+
|
|
150
|
+
- `HOME` - Home button
|
|
151
|
+
- `BACK` - Back button (Android only)
|
|
152
|
+
- `POWER` - Power button
|
|
153
|
+
- `VOLUME_UP`, `VOLUME_DOWN` - Volume up and down
|
|
154
|
+
- `DPAD_UP`, `DPAD_DOWN`, `DPAD_LEFT`, `DPAD_RIGHT`, `DPAD_CENTER` - D-pad controls (Android only)
|
|
155
|
+
|
|
156
|
+
## Platform-Specific Notes
|
|
157
|
+
|
|
158
|
+
### iOS Real Devices
|
|
159
|
+
- Currently requires that you install and run WebDriverAgent manually. You may change the BUNDLE IDENTIFIER, and *mobilecli* will be able to launch it if needed, as long as the identifier ends with `*.WebDriverAgent`.
|
|
160
|
+
|
|
161
|
+
## Development 👩💻
|
|
162
|
+
|
|
163
|
+
### Building 🛠️
|
|
164
|
+
|
|
165
|
+
Please refer to (docs/TESTING.md) for further instructions regarding testing *mobilecli* locally.
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
make lint
|
|
169
|
+
make build
|
|
170
|
+
make test
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
## Support 💬
|
|
174
|
+
|
|
175
|
+
For issues and feature requests, please use the [GitHub Issues](https://github.com/mobile-next/mobilecli/issues) page.
|
|
176
|
+
|
|
177
|
+
Be sure to <a href="http://mobilenexthq.com/join-slack">join our slack channel</a> today 💜
|
|
178
|
+
|
|
179
|
+
To learn more about <a href="https://mobilenexthq.com/">Mobile Next</a> and what we're building, <a href="https://mobilenexthq.com/#newsletter">subscribe to our newsletter</a>.
|
|
180
|
+
|
package/bin/mobilecli-darwin
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED