@limrun/cli 0.4.0 → 0.4.3
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 +1 -0
- package/dist/base-command.d.ts +2 -0
- package/dist/base-command.d.ts.map +1 -1
- package/dist/base-command.js +22 -2
- package/dist/base-command.js.map +1 -1
- package/dist/commands/android/delete.d.ts.map +1 -1
- package/dist/commands/android/delete.js +13 -1
- package/dist/commands/android/delete.js.map +1 -1
- package/dist/commands/ios/delete.d.ts.map +1 -1
- package/dist/commands/ios/delete.js +12 -1
- package/dist/commands/ios/delete.js.map +1 -1
- package/dist/commands/session/stop.d.ts.map +1 -1
- package/dist/commands/session/stop.js +4 -5
- package/dist/commands/session/stop.js.map +1 -1
- package/dist/commands/xcode/build.d.ts.map +1 -1
- package/dist/commands/xcode/build.js +10 -7
- package/dist/commands/xcode/build.js.map +1 -1
- package/dist/commands/xcode/create.d.ts +1 -0
- package/dist/commands/xcode/create.d.ts.map +1 -1
- package/dist/commands/xcode/create.js +85 -2
- package/dist/commands/xcode/create.js.map +1 -1
- package/dist/commands/xcode/delete.d.ts.map +1 -1
- package/dist/commands/xcode/delete.js +14 -1
- package/dist/commands/xcode/delete.js.map +1 -1
- package/dist/commands/xcode/sync.d.ts.map +1 -1
- package/dist/commands/xcode/sync.js +6 -3
- package/dist/commands/xcode/sync.js.map +1 -1
- package/dist/lib/config.d.ts +9 -1
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +19 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/daemon.d.ts +1 -0
- package/dist/lib/daemon.d.ts.map +1 -1
- package/dist/lib/daemon.js +11 -0
- package/dist/lib/daemon.js.map +1 -1
- package/dist/lib/duration.d.ts +2 -0
- package/dist/lib/duration.d.ts.map +1 -0
- package/dist/lib/duration.js +37 -0
- package/dist/lib/duration.js.map +1 -0
- package/package.json +1 -1
- package/dist/commands/exec/element-tree.d.ts +0 -15
- package/dist/commands/exec/element-tree.d.ts.map +0 -1
- package/dist/commands/exec/element-tree.js +0 -61
- package/dist/commands/exec/element-tree.js.map +0 -1
- package/dist/commands/exec/install-app.d.ts +0 -17
- package/dist/commands/exec/install-app.d.ts.map +0 -1
- package/dist/commands/exec/install-app.js +0 -84
- package/dist/commands/exec/install-app.js.map +0 -1
- package/dist/commands/exec/open-url.d.ts +0 -17
- package/dist/commands/exec/open-url.d.ts.map +0 -1
- package/dist/commands/exec/open-url.js +0 -48
- package/dist/commands/exec/open-url.js.map +0 -1
- package/dist/commands/exec/perform.d.ts +0 -17
- package/dist/commands/exec/perform.d.ts.map +0 -1
- package/dist/commands/exec/perform.js +0 -232
- package/dist/commands/exec/perform.js.map +0 -1
- package/dist/commands/exec/press-key.d.ts +0 -18
- package/dist/commands/exec/press-key.d.ts.map +0 -1
- package/dist/commands/exec/press-key.js +0 -49
- package/dist/commands/exec/press-key.js.map +0 -1
- package/dist/commands/exec/record.d.ts +0 -21
- package/dist/commands/exec/record.d.ts.map +0 -1
- package/dist/commands/exec/record.js +0 -101
- package/dist/commands/exec/record.js.map +0 -1
- package/dist/commands/exec/screenshot.d.ts +0 -16
- package/dist/commands/exec/screenshot.d.ts.map +0 -1
- package/dist/commands/exec/screenshot.js +0 -72
- package/dist/commands/exec/screenshot.js.map +0 -1
- package/dist/commands/exec/scroll.d.ts +0 -18
- package/dist/commands/exec/scroll.d.ts.map +0 -1
- package/dist/commands/exec/scroll.js +0 -58
- package/dist/commands/exec/scroll.js.map +0 -1
- package/dist/commands/exec/tap-element.d.ts +0 -19
- package/dist/commands/exec/tap-element.d.ts.map +0 -1
- package/dist/commands/exec/tap-element.js +0 -102
- package/dist/commands/exec/tap-element.js.map +0 -1
- package/dist/commands/exec/tap.d.ts +0 -24
- package/dist/commands/exec/tap.d.ts.map +0 -1
- package/dist/commands/exec/tap.js +0 -57
- package/dist/commands/exec/tap.js.map +0 -1
- package/dist/commands/exec/type.d.ts +0 -18
- package/dist/commands/exec/type.d.ts.map +0 -1
- package/dist/commands/exec/type.js +0 -54
- package/dist/commands/exec/type.js.map +0 -1
- package/dist/commands/ios/log.d.ts +0 -20
- package/dist/commands/ios/log.d.ts.map +0 -1
- package/dist/commands/ios/log.js +0 -105
- package/dist/commands/ios/log.js.map +0 -1
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const js_yaml_1 = __importDefault(require("js-yaml"));
|
|
8
|
-
const core_1 = require("@oclif/core");
|
|
9
|
-
const base_command_1 = require("../../base-command");
|
|
10
|
-
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
11
|
-
const IPC_TIMEOUT_BUFFER_MS = 5000;
|
|
12
|
-
function splitActionFields(raw) {
|
|
13
|
-
const fields = [];
|
|
14
|
-
let current = '';
|
|
15
|
-
let escaped = false;
|
|
16
|
-
for (const char of raw) {
|
|
17
|
-
if (escaped) {
|
|
18
|
-
current += char;
|
|
19
|
-
escaped = false;
|
|
20
|
-
continue;
|
|
21
|
-
}
|
|
22
|
-
if (char === '\\') {
|
|
23
|
-
escaped = true;
|
|
24
|
-
continue;
|
|
25
|
-
}
|
|
26
|
-
if (char === ',') {
|
|
27
|
-
fields.push(current);
|
|
28
|
-
current = '';
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
current += char;
|
|
32
|
-
}
|
|
33
|
-
if (escaped) {
|
|
34
|
-
current += '\\';
|
|
35
|
-
}
|
|
36
|
-
fields.push(current);
|
|
37
|
-
return fields;
|
|
38
|
-
}
|
|
39
|
-
function parseScalarValue(value) {
|
|
40
|
-
const trimmed = value.trim();
|
|
41
|
-
if ((trimmed.startsWith('{') && trimmed.endsWith('}')) ||
|
|
42
|
-
(trimmed.startsWith('[') && trimmed.endsWith(']')) ||
|
|
43
|
-
(trimmed.startsWith('"') && trimmed.endsWith('"'))) {
|
|
44
|
-
try {
|
|
45
|
-
return JSON.parse(trimmed);
|
|
46
|
-
}
|
|
47
|
-
catch {
|
|
48
|
-
// Fall through to plain string parsing if this is not valid JSON.
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
if (value === 'true')
|
|
52
|
-
return true;
|
|
53
|
-
if (value === 'false')
|
|
54
|
-
return false;
|
|
55
|
-
if (/^-?\d+(\.\d+)?$/.test(value))
|
|
56
|
-
return Number(value);
|
|
57
|
-
return value;
|
|
58
|
-
}
|
|
59
|
-
function parseAction(raw, index) {
|
|
60
|
-
const action = {};
|
|
61
|
-
for (const field of splitActionFields(raw)) {
|
|
62
|
-
const trimmed = field.trim();
|
|
63
|
-
if (!trimmed)
|
|
64
|
-
continue;
|
|
65
|
-
const equalsIndex = trimmed.indexOf('=');
|
|
66
|
-
if (equalsIndex === -1) {
|
|
67
|
-
throw new Error(`Action ${index + 1} field "${trimmed}" must use key=value syntax`);
|
|
68
|
-
}
|
|
69
|
-
const key = trimmed.slice(0, equalsIndex).trim();
|
|
70
|
-
const value = trimmed.slice(equalsIndex + 1);
|
|
71
|
-
if (!key) {
|
|
72
|
-
throw new Error(`Action ${index + 1} contains an empty key`);
|
|
73
|
-
}
|
|
74
|
-
action[key] = parseScalarValue(value);
|
|
75
|
-
}
|
|
76
|
-
if (typeof action.type !== 'string' || action.type.length === 0) {
|
|
77
|
-
throw new Error(`Action ${index + 1} must include type=<action-name>`);
|
|
78
|
-
}
|
|
79
|
-
return action;
|
|
80
|
-
}
|
|
81
|
-
function parseActionsDocument(raw, source) {
|
|
82
|
-
let parsed;
|
|
83
|
-
try {
|
|
84
|
-
parsed = js_yaml_1.default.load(raw);
|
|
85
|
-
}
|
|
86
|
-
catch (error) {
|
|
87
|
-
throw new Error(`Failed to parse actions from ${source}: ${error.message}`);
|
|
88
|
-
}
|
|
89
|
-
if (!Array.isArray(parsed)) {
|
|
90
|
-
throw new Error(`Actions in ${source} must be an array`);
|
|
91
|
-
}
|
|
92
|
-
for (const [index, action] of parsed.entries()) {
|
|
93
|
-
if (!action || typeof action !== 'object' || typeof action.type !== 'string') {
|
|
94
|
-
throw new Error(`Action at index ${index} in ${source} must be an object with a string "type" field`);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
return parsed;
|
|
98
|
-
}
|
|
99
|
-
function parseActions(rawActions) {
|
|
100
|
-
if (rawActions.length === 0) {
|
|
101
|
-
throw new Error('Provide at least one --action flag');
|
|
102
|
-
}
|
|
103
|
-
return rawActions.map((rawAction, index) => parseAction(rawAction, index));
|
|
104
|
-
}
|
|
105
|
-
async function readActions(flags) {
|
|
106
|
-
const hasInlineActions = (flags.action?.length ?? 0) > 0;
|
|
107
|
-
const hasFile = typeof flags.file === 'string';
|
|
108
|
-
if (!hasInlineActions && !hasFile) {
|
|
109
|
-
throw new Error('Provide either at least one --action flag or --file');
|
|
110
|
-
}
|
|
111
|
-
if (hasInlineActions && hasFile) {
|
|
112
|
-
throw new Error('Use either --action or --file, not both');
|
|
113
|
-
}
|
|
114
|
-
if (hasInlineActions) {
|
|
115
|
-
return parseActions(flags.action);
|
|
116
|
-
}
|
|
117
|
-
const raw = await fs_1.default.promises.readFile(flags.file, 'utf-8');
|
|
118
|
-
return parseActionsDocument(raw, flags.file);
|
|
119
|
-
}
|
|
120
|
-
function estimateTimeoutMs(actions, overrideTimeoutMs) {
|
|
121
|
-
if (overrideTimeoutMs !== undefined) {
|
|
122
|
-
return overrideTimeoutMs;
|
|
123
|
-
}
|
|
124
|
-
const waitMs = actions.reduce((total, action) => {
|
|
125
|
-
if (action.type !== 'wait' || typeof action.durationMs !== 'number') {
|
|
126
|
-
return total;
|
|
127
|
-
}
|
|
128
|
-
return total + Math.max(0, action.durationMs);
|
|
129
|
-
}, 0);
|
|
130
|
-
return 30000 + waitMs + actions.length * 2000;
|
|
131
|
-
}
|
|
132
|
-
class ExecPerform extends base_command_1.BaseCommand {
|
|
133
|
-
async run() {
|
|
134
|
-
const { flags } = await this.parse(ExecPerform);
|
|
135
|
-
this.setParsedFlags(flags);
|
|
136
|
-
await this.withAuth(async () => {
|
|
137
|
-
const id = this.resolveId(flags.id);
|
|
138
|
-
if ((0, instance_client_factory_1.detectInstanceType)(id) !== 'ios') {
|
|
139
|
-
this.error('perform is only supported on iOS instances');
|
|
140
|
-
}
|
|
141
|
-
const actions = await readActions(flags);
|
|
142
|
-
const timeoutMs = estimateTimeoutMs(actions, flags.timeout);
|
|
143
|
-
const ipcTimeoutMs = timeoutMs + IPC_TIMEOUT_BUFFER_MS;
|
|
144
|
-
let result;
|
|
145
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
146
|
-
// Keep the local socket alive slightly longer than the server-side
|
|
147
|
-
// request timeout so the daemon can return the real API outcome.
|
|
148
|
-
result = (await (0, instance_client_factory_1.sendSessionCommand)(id, 'perform-actions', [actions, flags.timeout], ipcTimeoutMs));
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
const { type, client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
152
|
-
try {
|
|
153
|
-
if (type !== 'ios') {
|
|
154
|
-
this.error('perform is only supported on iOS instances');
|
|
155
|
-
}
|
|
156
|
-
result = (await client.performActions(actions, flags.timeout !== undefined ? { timeoutMs: flags.timeout } : undefined));
|
|
157
|
-
}
|
|
158
|
-
finally {
|
|
159
|
-
disconnect();
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
if (flags.json) {
|
|
163
|
-
this.outputJson(result);
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
this.log(`Performed ${result.results.length} action${result.results.length === 1 ? '' : 's'}`);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
ExecPerform.summary = 'Perform multiple iOS actions in a single batch';
|
|
172
|
-
ExecPerform.description = 'Run a batch of iOS actions in a single CLI invocation using repeated `--action` flags or a JSON/YAML action file. This is the best choice for agent-driven multi-step interactions that should execute without reconnecting between steps.';
|
|
173
|
-
ExecPerform.examples = [
|
|
174
|
-
'<%= config.bin %> ios perform --action type=tap,x=100,y=200 --action "type=typeText,text=Hello World"',
|
|
175
|
-
'<%= config.bin %> ios perform --action type=wait,durationMs=1000 --action type=pressKey,key=enter',
|
|
176
|
-
'<%= config.bin %> ios perform --file ./actions.yaml',
|
|
177
|
-
];
|
|
178
|
-
ExecPerform.flags = {
|
|
179
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
180
|
-
id: core_1.Flags.string({
|
|
181
|
-
description: 'iOS instance ID to target. Defaults to the last created iOS instance.',
|
|
182
|
-
}),
|
|
183
|
-
action: core_1.Flags.string({
|
|
184
|
-
description: `Action definition as comma-separated key=value pairs; repeat for multiple actions.
|
|
185
|
-
|
|
186
|
-
Available action types:
|
|
187
|
-
- Tap on coordinate: type=tap,x=100,y=200
|
|
188
|
-
- Tap on element by using a selector: type=tapElement,selector={"AXLabel":"Submit"}
|
|
189
|
-
- Increment an element by using a selector: type=incrementElement,selector={"AXLabel":"Volume"}
|
|
190
|
-
- Decrement an element by using a selector: type=decrementElement,selector={"AXLabel":"Volume"}
|
|
191
|
-
- Set an element value by using a selector: type=setElementValue,text=42,selector={"AXLabel":"Counter"}
|
|
192
|
-
- Type text into the focused field: type=typeText,text=Hello World,pressEnter=true
|
|
193
|
-
- Press a key with optional modifiers: type=pressKey,key=a,modifiers=["shift"]
|
|
194
|
-
- Scroll the screen: type=scroll,direction=down,pixels=300,coordinate=[200,400],momentum=0.2
|
|
195
|
-
- Toggle the software keyboard: type=toggleKeyboard
|
|
196
|
-
- Open a URL or deep link: type=openUrl,url=https://example.com
|
|
197
|
-
- Set device orientation: type=setOrientation,orientation=Landscape
|
|
198
|
-
- Wait before the next action: type=wait,durationMs=1000
|
|
199
|
-
- Start a touch gesture: type=touchDown,x=100,y=200
|
|
200
|
-
- Move a touch gesture: type=touchMove,x=120,y=220
|
|
201
|
-
- End a touch gesture: type=touchUp,x=120,y=220
|
|
202
|
-
- Press a raw key code down: type=keyDown,keyCode=4
|
|
203
|
-
- Release a raw key code: type=keyUp,keyCode=4
|
|
204
|
-
- Press a hardware button down: type=buttonDown,button=home
|
|
205
|
-
- Release a hardware button: type=buttonUp,button=home
|
|
206
|
-
|
|
207
|
-
Use JSON values for complex fields like selector, modifiers, and coordinate.`,
|
|
208
|
-
multiple: true,
|
|
209
|
-
}),
|
|
210
|
-
file: core_1.Flags.string({
|
|
211
|
-
char: 'f',
|
|
212
|
-
description: `Path to a YAML or JSON file containing an array of action objects.
|
|
213
|
-
|
|
214
|
-
JSON example:
|
|
215
|
-
[
|
|
216
|
-
{ "type": "tap", "x": 100, "y": 200 },
|
|
217
|
-
{ "type": "typeText", "text": "Hello World" }
|
|
218
|
-
]
|
|
219
|
-
|
|
220
|
-
YAML example:
|
|
221
|
-
- type: tap
|
|
222
|
-
x: 100
|
|
223
|
-
y: 200
|
|
224
|
-
- type: typeText
|
|
225
|
-
text: "Hello World"`,
|
|
226
|
-
}),
|
|
227
|
-
timeout: core_1.Flags.integer({
|
|
228
|
-
description: 'Override the total batch timeout in milliseconds. By default the CLI grows the timeout based on waits and action count.',
|
|
229
|
-
}),
|
|
230
|
-
};
|
|
231
|
-
exports.default = ExecPerform;
|
|
232
|
-
//# sourceMappingURL=perform.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"perform.js","sourceRoot":"","sources":["../../../src/commands/exec/perform.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,sDAA2B;AAC3B,sCAAoC;AACpC,qDAAiD;AACjD,+EAK2C;AAY3C,MAAM,qBAAqB,GAAG,IAAK,CAAC;AAEpC,SAAS,iBAAiB,CAAC,GAAW;IACpC,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,OAAO,GAAG,EAAE,CAAC;IACjB,IAAI,OAAO,GAAG,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;gBAC7B,CAAC;wBAAS,CAAC;oBACT,UAAU,EAAE,CAAC;gBACf,CAAC;YACH,CAAC;YAED,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;gBACf,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;YAC1B,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,GAAG,CAAC,aAAa,MAAM,CAAC,OAAO,CAAC,MAAM,UAAU,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;YACjG,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;;AA7GM,mBAAO,GAAG,gDAAgD,CAAC;AAC3D,uBAAW,GAChB,4OAA4O,CAAC;AACxO,oBAAQ,GAAG;IAChB,uGAAuG;IACvG,mGAAmG;IACnG,qDAAqD;CACtD,CAAC;AAEK,iBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,uEAAuE;KACrF,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,WAAW,EAAE;;;;;;;;;;;;;;;;;;;;;;;6EAuB0D;QACvE,QAAQ,EAAE,IAAI;KACf,CAAC;IACF,IAAI,EAAE,YAAK,CAAC,MAAM,CAAC;QACjB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE;;;;;;;;;;;;;sBAaG;KACjB,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EACT,yHAAyH;KAC5H,CAAC;CACH,CAAC;kBA/DiB,WAAW"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base-command';
|
|
2
|
-
export default class ExecPressKey extends BaseCommand {
|
|
3
|
-
static summary: string;
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
key: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
-
};
|
|
9
|
-
static flags: {
|
|
10
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
modifier: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
};
|
|
16
|
-
run(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=press-key.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"press-key.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/press-key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,YAAa,SAAQ,WAAW;IACnD,MAAM,CAAC,OAAO,SAAuC;IACrD,MAAM,CAAC,WAAW,SAC+J;IACjL,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI;;MAET;IAEF,MAAM,CAAC,KAAK;;;;;;MAUV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAmB3B"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const base_command_1 = require("../../base-command");
|
|
5
|
-
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
6
|
-
class ExecPressKey extends base_command_1.BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
const { args, flags } = await this.parse(ExecPressKey);
|
|
9
|
-
this.setParsedFlags(flags);
|
|
10
|
-
await this.withAuth(async () => {
|
|
11
|
-
const id = this.resolveId(flags.id);
|
|
12
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
13
|
-
await (0, instance_client_factory_1.sendSessionCommand)(id, 'press-key', [args.key, flags.modifier]);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
const { client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
17
|
-
try {
|
|
18
|
-
await client.pressKey(args.key, flags.modifier);
|
|
19
|
-
}
|
|
20
|
-
finally {
|
|
21
|
-
disconnect();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
this.log(`Pressed key: ${args.key}`);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
ExecPressKey.summary = 'Press a key on a running instance';
|
|
29
|
-
ExecPressKey.description = 'Send a keyboard key press to the focused app or text field on a running iOS or Android instance. You can repeat `--modifier` to combine keys such as Command, Shift, or Alt.';
|
|
30
|
-
ExecPressKey.examples = [
|
|
31
|
-
'<%= config.bin %> ios press-key enter',
|
|
32
|
-
'<%= config.bin %> ios press-key a --modifier shift --id <instance-ID>',
|
|
33
|
-
'<%= config.bin %> android press-key tab',
|
|
34
|
-
];
|
|
35
|
-
ExecPressKey.args = {
|
|
36
|
-
key: core_1.Args.string({ description: 'Key to press (e.g. enter, backspace, a, f1)', required: true }),
|
|
37
|
-
};
|
|
38
|
-
ExecPressKey.flags = {
|
|
39
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
40
|
-
id: core_1.Flags.string({
|
|
41
|
-
description: 'Instance ID to target. Defaults to the last created instance of the command alias type.',
|
|
42
|
-
}),
|
|
43
|
-
modifier: core_1.Flags.string({
|
|
44
|
-
description: 'Modifier key to hold during the press, such as shift, command, control, or alt. Repeat for multiple modifiers.',
|
|
45
|
-
multiple: true,
|
|
46
|
-
}),
|
|
47
|
-
};
|
|
48
|
-
exports.default = ExecPressKey;
|
|
49
|
-
//# sourceMappingURL=press-key.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"press-key.js","sourceRoot":"","sources":["../../../src/commands/exec/press-key.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,YAAa,SAAQ,0BAAW;IA0BnD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC;QACvD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpC,IAAI,IAAA,0CAAgB,EAAC,EAAE,CAAC,EAAE,CAAC;gBACzB,MAAM,IAAA,4CAAkB,EAAC,EAAE,EAAE,WAAW,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;YACxE,CAAC;iBAAM,CAAC;gBACN,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,2CAAiB,EAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBACxE,IAAI,CAAC;oBACH,MAAO,MAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;gBAC3D,CAAC;wBAAS,CAAC;oBACT,UAAU,EAAE,CAAC;gBACf,CAAC;YACH,CAAC;YACD,IAAI,CAAC,GAAG,CAAC,gBAAgB,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;;AA3CM,oBAAO,GAAG,mCAAmC,CAAC;AAC9C,wBAAW,GAChB,8KAA8K,CAAC;AAC1K,qBAAQ,GAAG;IAChB,uCAAuC;IACvC,uEAAuE;IACvE,yCAAyC;CAC1C,CAAC;AAEK,iBAAI,GAAG;IACZ,GAAG,EAAE,WAAI,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACjG,CAAC;AAEK,kBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,yFAAyF;KACvG,CAAC;IACF,QAAQ,EAAE,YAAK,CAAC,MAAM,CAAC;QACrB,WAAW,EACT,gHAAgH;QAClH,QAAQ,EAAE,IAAI;KACf,CAAC;CACH,CAAC;kBAxBiB,YAAY"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base-command';
|
|
2
|
-
export default class ExecRecord extends BaseCommand {
|
|
3
|
-
static summary: string;
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
action: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
-
};
|
|
9
|
-
static flags: {
|
|
10
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
quality: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
'presigned-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
|
-
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
17
|
-
};
|
|
18
|
-
run(): Promise<void>;
|
|
19
|
-
private defaultRecordingPath;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,OAAO,SAAyD;IACvE,MAAM,CAAC,WAAW,SACuK;IACzL,MAAM,CAAC,QAAQ,WAQb;IAEF,MAAM,CAAC,IAAI;;MAOT;IAEF,MAAM,CAAC,KAAK;;;;;;;;MAmBV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C1B,OAAO,CAAC,oBAAoB;CAI7B"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const path_1 = __importDefault(require("path"));
|
|
7
|
-
const core_1 = require("@oclif/core");
|
|
8
|
-
const base_command_1 = require("../../base-command");
|
|
9
|
-
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
10
|
-
class ExecRecord extends base_command_1.BaseCommand {
|
|
11
|
-
async run() {
|
|
12
|
-
const { args, flags } = await this.parse(ExecRecord);
|
|
13
|
-
this.setParsedFlags(flags);
|
|
14
|
-
await this.withAuth(async () => {
|
|
15
|
-
const id = this.resolveId(flags.id);
|
|
16
|
-
if (args.action === 'start') {
|
|
17
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
18
|
-
await (0, instance_client_factory_1.sendSessionCommand)(id, 'start-recording', [flags.quality]);
|
|
19
|
-
}
|
|
20
|
-
else {
|
|
21
|
-
const { client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
22
|
-
try {
|
|
23
|
-
await client.startRecording({ quality: flags.quality });
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
disconnect();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
this.log('Recording started');
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
const outputPath = flags.output ? path_1.default.resolve(flags.output) : this.defaultRecordingPath();
|
|
33
|
-
const saveTo = {
|
|
34
|
-
localPath: outputPath,
|
|
35
|
-
presignedUrl: flags['presigned-url'],
|
|
36
|
-
};
|
|
37
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
38
|
-
await (0, instance_client_factory_1.sendSessionCommand)(id, 'stop-recording', [saveTo]);
|
|
39
|
-
this.log(`Recording saved to ${outputPath}`);
|
|
40
|
-
if (flags['presigned-url']) {
|
|
41
|
-
this.log('Recording uploaded using the provided presigned URL');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
const { client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
46
|
-
try {
|
|
47
|
-
await client.stopRecording(saveTo);
|
|
48
|
-
this.log(`Recording saved to ${outputPath}`);
|
|
49
|
-
if (flags['presigned-url']) {
|
|
50
|
-
this.log('Recording uploaded using the provided presigned URL');
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
finally {
|
|
54
|
-
disconnect();
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
defaultRecordingPath() {
|
|
61
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
62
|
-
return path_1.default.join(process.cwd(), `video_${timestamp}.mp4`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
ExecRecord.summary = 'Start or stop video recording on a running instance';
|
|
66
|
-
ExecRecord.description = 'Control screen recording on a running iOS or Android instance. Start recording first, then stop recording to download the file locally or upload it directly with `--presigned-url`.';
|
|
67
|
-
ExecRecord.examples = [
|
|
68
|
-
'<%= config.bin %> ios record start',
|
|
69
|
-
'<%= config.bin %> ios record stop',
|
|
70
|
-
'<%= config.bin %> ios record stop -o recording.mp4 --id <instance-ID>',
|
|
71
|
-
'<%= config.bin %> ios record stop --presigned-url https://example.com/upload --id <instance-ID>',
|
|
72
|
-
'<%= config.bin %> ios record start --quality 8',
|
|
73
|
-
'<%= config.bin %> android record stop --id <instance-ID>',
|
|
74
|
-
'<%= config.bin %> android record stop --presigned-url https://example.com/upload --id <instance-ID>',
|
|
75
|
-
];
|
|
76
|
-
ExecRecord.args = {
|
|
77
|
-
action: core_1.Args.string({
|
|
78
|
-
description: 'Recording action to perform: `start` begins capturing and `stop` finalizes the video file',
|
|
79
|
-
required: true,
|
|
80
|
-
options: ['start', 'stop'],
|
|
81
|
-
}),
|
|
82
|
-
};
|
|
83
|
-
ExecRecord.flags = {
|
|
84
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
85
|
-
id: core_1.Flags.string({
|
|
86
|
-
description: 'Instance ID to record. Defaults to the last created instance of the command alias type.',
|
|
87
|
-
}),
|
|
88
|
-
quality: core_1.Flags.integer({
|
|
89
|
-
description: 'Recording quality from 5 to 10. Higher values increase quality and file size when starting a recording.',
|
|
90
|
-
default: 5,
|
|
91
|
-
}),
|
|
92
|
-
output: core_1.Flags.string({
|
|
93
|
-
char: 'o',
|
|
94
|
-
description: 'Local file path for the finished recording when using the `stop` action. Defaults to a timestamped mp4 in the current directory.',
|
|
95
|
-
}),
|
|
96
|
-
'presigned-url': core_1.Flags.string({
|
|
97
|
-
description: 'Presigned upload URL to receive the recording when using the `stop` action. Use this if you will upload the recording to a bucket.',
|
|
98
|
-
}),
|
|
99
|
-
};
|
|
100
|
-
exports.default = ExecRecord;
|
|
101
|
-
//# sourceMappingURL=record.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,UAAW,SAAQ,0BAAW;IA4CjD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpC,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBAC5B,IAAI,IAAA,0CAAgB,EAAC,EAAE,CAAC,EAAE,CAAC;oBACzB,MAAM,IAAA,4CAAkB,EAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;gBACnE,CAAC;qBAAM,CAAC;oBACN,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,2CAAiB,EAAC,IAAI,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;oBACxE,IAAI,CAAC;wBACH,MAAO,MAAc,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;oBACnE,CAAC;4BAAS,CAAC;wBACT,UAAU,EAAE,CAAC;oBACf,CAAC;gBACH,CAAC;gBACD,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YAChC,CAAC;iBAAM,CAAC;gBACN,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,cAAI,CAAC,OAA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AS,MAAM,CAAC,CAAC;IAC5D,CAAC;;AA7FM,kBAAO,GAAG,qDAAqD,CAAC;AAChE,sBAAW,GAChB,sLAAsL,CAAC;AAClL,mBAAQ,GAAG;IAChB,oCAAoC;IACpC,mCAAmC;IACnC,uEAAuE;IACvE,iGAAiG;IACjG,gDAAgD;IAChD,0DAA0D;IAC1D,qGAAqG;CACtG,CAAC;AAEK,eAAI,GAAG;IACZ,MAAM,EAAE,WAAI,CAAC,MAAM,CAAC;QAClB,WAAW,EACT,2FAA2F;QAC7F,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH,CAAC;AAEK,gBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,yFAAyF;KACvG,CAAC;IACF,OAAO,EAAE,YAAK,CAAC,OAAO,CAAC;QACrB,WAAW,EACT,yGAAyG;QAC3G,OAAO,EAAE,CAAC;KACX,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EACT,kIAAkI;KACrI,CAAC;IACF,eAAe,EAAE,YAAK,CAAC,MAAM,CAAC;QAC5B,WAAW,EACT,oIAAoI;KACvI,CAAC;CACH,CAAC;kBA1CiB,UAAU"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base-command';
|
|
2
|
-
export default class ExecScreenshot extends BaseCommand {
|
|
3
|
-
static summary: string;
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static args: {};
|
|
7
|
-
static flags: {
|
|
8
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
9
|
-
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
10
|
-
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
12
|
-
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
13
|
-
};
|
|
14
|
-
run(): Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=screenshot.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/screenshot.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,WAAW;IACrD,MAAM,CAAC,OAAO,SAAkD;IAChE,MAAM,CAAC,WAAW,SAC8I;IAChK,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI,KAAM;IAEjB,MAAM,CAAC,KAAK;;;;;;MASV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAsC3B"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const fs_1 = __importDefault(require("fs"));
|
|
7
|
-
const path_1 = __importDefault(require("path"));
|
|
8
|
-
const core_1 = require("@oclif/core");
|
|
9
|
-
const base_command_1 = require("../../base-command");
|
|
10
|
-
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
11
|
-
class ExecScreenshot extends base_command_1.BaseCommand {
|
|
12
|
-
async run() {
|
|
13
|
-
const { flags } = await this.parse(ExecScreenshot);
|
|
14
|
-
this.setParsedFlags(flags);
|
|
15
|
-
await this.withAuth(async () => {
|
|
16
|
-
const id = this.resolveId(flags.id);
|
|
17
|
-
let screenshot;
|
|
18
|
-
let type;
|
|
19
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
20
|
-
screenshot = await (0, instance_client_factory_1.sendSessionCommand)(id, 'screenshot');
|
|
21
|
-
type = id.split('_')[0];
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const resolved = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
25
|
-
type = resolved.type;
|
|
26
|
-
try {
|
|
27
|
-
screenshot = await resolved.client.screenshot();
|
|
28
|
-
}
|
|
29
|
-
finally {
|
|
30
|
-
resolved.disconnect();
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (flags.output) {
|
|
34
|
-
const outPath = path_1.default.resolve(flags.output);
|
|
35
|
-
if (type === 'ios') {
|
|
36
|
-
fs_1.default.writeFileSync(outPath, Buffer.from(screenshot.base64, 'base64'));
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
const base64 = screenshot.dataUri.replace(/^data:image\/\w+;base64,/, '');
|
|
40
|
-
fs_1.default.writeFileSync(outPath, Buffer.from(base64, 'base64'));
|
|
41
|
-
}
|
|
42
|
-
this.log(`Screenshot saved to ${outPath}`);
|
|
43
|
-
}
|
|
44
|
-
else if (flags.json) {
|
|
45
|
-
this.outputJson(screenshot);
|
|
46
|
-
}
|
|
47
|
-
else {
|
|
48
|
-
this.log(type === 'ios' ? screenshot.base64 : screenshot.dataUri);
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
ExecScreenshot.summary = 'Capture a screenshot from a running instance';
|
|
54
|
-
ExecScreenshot.description = 'Capture the current screen from a running iOS or Android instance. Save the image to a file with `-o`, or use `--json` to inspect the raw response payload.';
|
|
55
|
-
ExecScreenshot.examples = [
|
|
56
|
-
'<%= config.bin %> ios screenshot -o screenshot.png',
|
|
57
|
-
'<%= config.bin %> android screenshot --id <instance-ID>',
|
|
58
|
-
'<%= config.bin %> ios screenshot --json',
|
|
59
|
-
];
|
|
60
|
-
ExecScreenshot.args = {};
|
|
61
|
-
ExecScreenshot.flags = {
|
|
62
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
63
|
-
id: core_1.Flags.string({
|
|
64
|
-
description: 'Instance ID to capture. Defaults to the last created instance of the command alias type.',
|
|
65
|
-
}),
|
|
66
|
-
output: core_1.Flags.string({
|
|
67
|
-
char: 'o',
|
|
68
|
-
description: 'File path where the screenshot should be written instead of printing the raw image data',
|
|
69
|
-
}),
|
|
70
|
-
};
|
|
71
|
-
exports.default = ExecScreenshot;
|
|
72
|
-
//# sourceMappingURL=screenshot.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"screenshot.js","sourceRoot":"","sources":["../../../src/commands/exec/screenshot.ts"],"names":[],"mappings":";;;;;AAAA,4CAAoB;AACpB,gDAAwB;AACxB,sCAAoC;AACpC,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,cAAe,SAAQ,0BAAW;IAuBrD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YACpC,IAAI,UAAe,CAAC;YACpB,IAAI,IAAY,CAAC;YAEjB,IAAI,IAAA,0CAAgB,EAAC,EAAE,CAAC,EAAE,CAAC;gBACzB,UAAU,GAAG,MAAM,IAAA,4CAAkB,EAAC,EAAE,EAAE,YAAY,CAAC,CAAC;gBACxD,IAAI,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YAC1B,CAAC;iBAAM,CAAC;g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A8C,CAAC;AACzD,0BAAW,GAChB,6JAA6J,CAAC;AACzJ,uBAAQ,GAAG;IAChB,oDAAoD;IACpD,yDAAyD;IACzD,yCAAyC;CAC1C,CAAC;AAEK,mBAAI,GAAG,EAAE,CAAC;AAEV,oBAAK,GAAG;IACb,GAAG,0BAAW,CAAC,SAAS;IACxB,EAAE,EAAE,YAAK,CAAC,MAAM,CAAC;QACf,WAAW,EAAE,0FAA0F;KACxG,CAAC;IACF,MAAM,EAAE,YAAK,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,yFAAyF;KACvG,CAAC;CACH,CAAC;kBArBiB,cAAc"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { BaseCommand } from '../../base-command';
|
|
2
|
-
export default class ExecScroll extends BaseCommand {
|
|
3
|
-
static summary: string;
|
|
4
|
-
static description: string;
|
|
5
|
-
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
direction: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
|
|
8
|
-
};
|
|
9
|
-
static flags: {
|
|
10
|
-
id: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
11
|
-
amount: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
|
-
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
-
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
14
|
-
quiet: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
|
-
};
|
|
16
|
-
run(): Promise<void>;
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=scroll.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/scroll.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,OAAO,SAAkC;IAChD,MAAM,CAAC,WAAW,SACgI;IAClJ,MAAM,CAAC,QAAQ,WAIb;IAEF,MAAM,CAAC,IAAI;;MAMT;IAEF,MAAM,CAAC,KAAK;;;;;;MASV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;CAuB3B"}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const core_1 = require("@oclif/core");
|
|
4
|
-
const base_command_1 = require("../../base-command");
|
|
5
|
-
const instance_client_factory_1 = require("../../lib/instance-client-factory");
|
|
6
|
-
class ExecScroll extends base_command_1.BaseCommand {
|
|
7
|
-
async run() {
|
|
8
|
-
const { args, flags } = await this.parse(ExecScroll);
|
|
9
|
-
this.setParsedFlags(flags);
|
|
10
|
-
await this.withAuth(async () => {
|
|
11
|
-
const id = this.resolveId(flags.id);
|
|
12
|
-
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
13
|
-
await (0, instance_client_factory_1.sendSessionCommand)(id, 'scroll', [args.direction, flags.amount]);
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
const { type, client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
17
|
-
try {
|
|
18
|
-
if (type === 'ios') {
|
|
19
|
-
await client.scroll(args.direction, flags.amount);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
await client.scrollScreen(args.direction, flags.amount);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
finally {
|
|
26
|
-
disconnect();
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
this.log(`Scrolled ${args.direction}`);
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
ExecScroll.summary = 'Scroll on a running instance';
|
|
34
|
-
ExecScroll.description = 'Scroll the current screen on a running iOS or Android instance. The amount uses pixels on iOS and the Android client scroll units on Android.';
|
|
35
|
-
ExecScroll.examples = [
|
|
36
|
-
'<%= config.bin %> ios scroll down --amount 500',
|
|
37
|
-
'<%= config.bin %> ios scroll down --amount 500 --id <instance-ID>',
|
|
38
|
-
'<%= config.bin %> android scroll up --amount 300',
|
|
39
|
-
];
|
|
40
|
-
ExecScroll.args = {
|
|
41
|
-
direction: core_1.Args.string({
|
|
42
|
-
description: 'Scroll direction to apply',
|
|
43
|
-
required: true,
|
|
44
|
-
options: ['up', 'down', 'left', 'right'],
|
|
45
|
-
}),
|
|
46
|
-
};
|
|
47
|
-
ExecScroll.flags = {
|
|
48
|
-
...base_command_1.BaseCommand.baseFlags,
|
|
49
|
-
id: core_1.Flags.string({
|
|
50
|
-
description: 'Instance ID to target. Defaults to the last created instance of the command alias type.',
|
|
51
|
-
}),
|
|
52
|
-
amount: core_1.Flags.integer({
|
|
53
|
-
description: 'Scroll amount. Uses pixels on iOS and Android scroll units on Android.',
|
|
54
|
-
default: 300,
|
|
55
|
-
}),
|
|
56
|
-
};
|
|
57
|
-
exports.default = ExecScroll;
|
|
58
|
-
//# sourceMappingURL=scroll.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scroll.js","sourceRoot":"","sources":["../../../src/commands/exec/scroll.ts"],"names":[],"mappings":";;AAAA,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,UAAW,SAAQ,0BAAW;IA6BjD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,G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