runcloud 0.1.108 → 0.1.110
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 +33 -0
- package/dist/api.js +111 -37
- package/dist/commands/run-cloud.js +680 -6
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/runcloud-0.1.110.tgz +0 -0
- package/skills/run-cloud-ios-simulator/SKILL.md +115 -124
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.1.
|
|
1
|
+
export const CLI_VERSION = '0.1.110';
|
package/package.json
CHANGED
|
Binary file
|
|
@@ -1,44 +1,32 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: run-cloud-ios-simulator
|
|
3
|
-
description: Operate run.cloud iOS simulator and Android emulator sessions with the CLI or TypeScript SDK. Use for creating, installing, inspecting, reading
|
|
3
|
+
description: Operate run.cloud iOS simulator and Android emulator sessions with the CLI or TypeScript SDK. Use for creating, installing, inspecting, reading logs, controlling, embedding, smoke-testing, connecting local Metro, taking screenshots or screen recordings, injecting iOS media, or releasing remote mobile sessions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Operate run.cloud Mobile Sessions
|
|
7
7
|
|
|
8
|
-
Use
|
|
9
|
-
`@run-cloud/
|
|
8
|
+
Use the `runcloud` CLI for terminal workflows, `@run-cloud/sdk` for TypeScript,
|
|
9
|
+
and `@run-cloud/ui` for React embeds.
|
|
10
10
|
|
|
11
11
|
## Authenticate
|
|
12
12
|
|
|
13
13
|
- Install the CLI with `npm install -g runcloud`.
|
|
14
|
-
- Use `runcloud login`
|
|
15
|
-
`runcloud login --manual` when a local callback cannot open.
|
|
14
|
+
- Use `runcloud login`; add `--manual` when a local callback cannot open.
|
|
16
15
|
- In CI, set `RUN_CLOUD_API_KEY`. `RUN_CLOUD_API_TOKEN` is an equivalent alias.
|
|
17
|
-
- Set `RUN_CLOUD_API_URL` only to override
|
|
18
|
-
|
|
19
|
-
- Never print, commit, or place credentials in a skill file.
|
|
20
|
-
|
|
21
|
-
- Require Node.js 20 or newer for the CLI and TypeScript SDK.
|
|
16
|
+
- Set `RUN_CLOUD_API_URL` only to override `https://api.run.cloud`.
|
|
17
|
+
- Require Node.js 20 or newer.
|
|
18
|
+
- Never print, commit, or place credentials in a skill file. Treat signed session
|
|
19
|
+
and tunnel URLs as bearer secrets.
|
|
22
20
|
|
|
23
|
-
|
|
21
|
+
Check access and credit before starting metered work:
|
|
24
22
|
|
|
25
23
|
```bash
|
|
26
24
|
runcloud account --json
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
available fleet capacity. A create request may queue while capacity is full.
|
|
27
|
+
The SDK equivalents are `cloud.account()` and `cloud.usage({ orgId? })`.
|
|
31
28
|
|
|
32
|
-
##
|
|
33
|
-
|
|
34
|
-
- Prefer CLI commands with `--json` for shell automation.
|
|
35
|
-
- Prefer `@run-cloud/sdk` for TypeScript applications and CI.
|
|
36
|
-
- Inspect `runcloud <command> --help` or installed SDK types before using a
|
|
37
|
-
method not documented here.
|
|
38
|
-
|
|
39
|
-
## Use the CLI
|
|
40
|
-
|
|
41
|
-
Create an iOS session, capture its ID, open a deep link, and release it:
|
|
29
|
+
## Create and Release Sessions
|
|
42
30
|
|
|
43
31
|
```bash
|
|
44
32
|
SESSION_ID=$(runcloud ios create \
|
|
@@ -48,79 +36,67 @@ SESSION_ID=$(runcloud ios create \
|
|
|
48
36
|
--json | jq -r '.id')
|
|
49
37
|
|
|
50
38
|
trap 'runcloud ios delete "$SESSION_ID" >/dev/null 2>&1 || true' EXIT
|
|
51
|
-
|
|
52
39
|
runcloud ios get "$SESSION_ID" --json
|
|
53
|
-
runcloud ios open-url myapp://settings --id "$SESSION_ID" --json
|
|
54
40
|
```
|
|
55
41
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
42
|
+
Replace `ios` with `android` for an Android artifact. The shared lifecycle is
|
|
43
|
+
`create`, `list`, `get`, `open-url`, `logs`, and `delete`. Use `--json` whenever
|
|
44
|
+
another program consumes output, and inspect `runcloud ios|android --help` for
|
|
45
|
+
create and log options.
|
|
59
46
|
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
- `runcloud ios|android open-url <url> --id <id>`
|
|
64
|
-
- `runcloud ios|android logs <id> [--tail N|--follow]`
|
|
65
|
-
- `runcloud ios|android delete <id>`
|
|
47
|
+
iOS needs an Apple Silicon simulator-compatible `.app`, `.zip`, `.tar.gz`, or
|
|
48
|
+
`.ipa`; a device-signed App Store IPA is not a substitute. Android needs an
|
|
49
|
+
emulator-compatible APK.
|
|
66
50
|
|
|
67
|
-
|
|
68
|
-
repeatable `--install`, repeatable `--install-asset`,
|
|
69
|
-
`--inactivity-timeout`, `--hard-timeout`, `--codec`, `--rm`, and `--json`.
|
|
51
|
+
## Control a Session
|
|
70
52
|
|
|
71
|
-
|
|
53
|
+
Both platform groups expose acknowledged controls:
|
|
72
54
|
|
|
73
55
|
```bash
|
|
74
|
-
runcloud
|
|
75
|
-
runcloud ios
|
|
76
|
-
|
|
77
|
-
runcloud
|
|
78
|
-
runcloud ios
|
|
79
|
-
runcloud
|
|
80
|
-
runcloud asset pull <asset-id> --output ./MyApp.tar.gz
|
|
81
|
-
runcloud asset delete <asset-id> --json
|
|
56
|
+
runcloud ios tap "$SESSION_ID" 0.5 0.3 --json
|
|
57
|
+
runcloud ios swipe "$SESSION_ID" 0.5 0.8 0.5 0.2 --duration 300 --json
|
|
58
|
+
runcloud ios type-text "$SESSION_ID" 'hello' --json
|
|
59
|
+
runcloud ios press-key "$SESSION_ID" enter --json
|
|
60
|
+
runcloud ios press-button "$SESSION_ID" home --json
|
|
61
|
+
runcloud ios screenshot "$SESSION_ID" --output ios.png --json
|
|
82
62
|
```
|
|
83
63
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
64
|
+
The full control set is `tap`, `swipe`, `gesture`, `type-text`, `press-key`,
|
|
65
|
+
`press-button`, `rotate`, `reload`, `scroll`, `toggle-software-keyboard`,
|
|
66
|
+
`simulate-memory-warning`, `rotate-digital-crown`, `set-render-debug`, and
|
|
67
|
+
`screenshot`. Every interaction accepts `--request-id`, `--timeout`, and
|
|
68
|
+
`--json`; use `runcloud <platform> <control> --help` for its typed arguments.
|
|
87
69
|
|
|
88
|
-
|
|
70
|
+
Coordinates use the current display orientation: `(0, 0)` is top-left and
|
|
71
|
+
`(1, 1)` is bottom-right. Gesture steps use one or two points with `begin`,
|
|
72
|
+
`move`, and `end` phases. Each `delayMs` is the pause before the next step, so
|
|
73
|
+
the final `end` step must use `0`. Key names are semantic US-keyboard names;
|
|
74
|
+
modifiers are `shift`, `control`, `alt`, and `meta`. Current mobile sessions do
|
|
75
|
+
not support Digital Crown input, and Android does not support iOS render-debug
|
|
76
|
+
controls or the `capsLock`, `numLock`, and `scrollLock` keys. Handle structured
|
|
77
|
+
`unsupported_action` errors instead of retrying them.
|
|
89
78
|
|
|
90
|
-
|
|
79
|
+
An acknowledgement means input dispatch completed. Confirm visible app effects
|
|
80
|
+
with a screenshot or the signed viewer when the outcome matters.
|
|
91
81
|
|
|
92
|
-
|
|
93
|
-
runcloud ios logs "$SESSION_ID" --tail 1000
|
|
94
|
-
runcloud android logs "$SESSION_ID" --tail 1000
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Use `--follow` while reproducing an issue, and add `--json` when another tool
|
|
98
|
-
will consume the entries. `--tail` and `--follow` are mutually exclusive.
|
|
99
|
-
Before releasing a failed session, always capture a bounded snapshot and keep
|
|
100
|
-
the relevant entries with the test evidence. A follow stream contains only new
|
|
101
|
-
entries and is not a substitute for the retained snapshot.
|
|
102
|
-
|
|
103
|
-
## Connect Local Development
|
|
82
|
+
## Record the Screen
|
|
104
83
|
|
|
105
|
-
|
|
84
|
+
Both platforms expose the same session-scoped recording lifecycle:
|
|
106
85
|
|
|
107
86
|
```bash
|
|
108
|
-
runcloud ios
|
|
109
|
-
--
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
runcloud ios tunnel-status --json
|
|
87
|
+
RECORDING_ID=$(runcloud ios recording start "$SESSION_ID" \
|
|
88
|
+
--idempotency-key "task-${TASK_ID:-manual}" --json | jq -r '.id')
|
|
89
|
+
runcloud ios recording stop "$SESSION_ID" "$RECORDING_ID" --json
|
|
90
|
+
runcloud ios recording download "$SESSION_ID" "$RECORDING_ID" \
|
|
91
|
+
--output ./recording.mp4 --json
|
|
114
92
|
```
|
|
115
93
|
|
|
116
|
-
Use
|
|
117
|
-
|
|
118
|
-
|
|
94
|
+
Use `recording list` and `recording status` to inspect retained state,
|
|
95
|
+
lifecycle events, and actionable failures. Replace `ios` with `android` for an
|
|
96
|
+
Android session. Reuse the idempotency key when retrying `start`.
|
|
119
97
|
|
|
120
98
|
## Use the TypeScript SDK
|
|
121
99
|
|
|
122
|
-
Install the SDK:
|
|
123
|
-
|
|
124
100
|
```bash
|
|
125
101
|
npm install @run-cloud/sdk
|
|
126
102
|
```
|
|
@@ -132,84 +108,99 @@ import { writeFile } from "node:fs/promises";
|
|
|
132
108
|
import { Client } from "@run-cloud/sdk";
|
|
133
109
|
|
|
134
110
|
const cloud = new Client();
|
|
135
|
-
const session = await cloud.
|
|
136
|
-
displayName: "Agent smoke",
|
|
137
|
-
tags: { owner: "agent" },
|
|
111
|
+
const session = await cloud.android.create({
|
|
138
112
|
inactivityTimeout: "60s",
|
|
139
113
|
hardTimeout: "10m",
|
|
140
|
-
|
|
114
|
+
tags: { owner: "agent" },
|
|
141
115
|
});
|
|
142
116
|
|
|
143
117
|
try {
|
|
144
|
-
await cloud.
|
|
145
|
-
|
|
146
|
-
await
|
|
118
|
+
await cloud.android.tap(session.id, { x: 0.5, y: 0.3 });
|
|
119
|
+
await cloud.android.typeText(session.id, "hello");
|
|
120
|
+
await cloud.android.pressKey(session.id, "enter");
|
|
121
|
+
const screenshot = await cloud.android.screenshot(session.id);
|
|
122
|
+
await writeFile("android.png", screenshot);
|
|
147
123
|
} finally {
|
|
148
|
-
await cloud.
|
|
124
|
+
await cloud.android.delete(session.id);
|
|
149
125
|
}
|
|
150
126
|
```
|
|
151
127
|
|
|
152
|
-
|
|
128
|
+
`cloud.ios`, `cloud.android`, and the platform-selectable `cloud.simulators`
|
|
129
|
+
expose `interact` plus convenience methods matching every CLI control above.
|
|
130
|
+
Interaction options accept `requestId`, `timeoutMs`, and `signal`; results are
|
|
131
|
+
typed acknowledgements. Use `RunCloudError` fields such as `code`, `retryable`,
|
|
132
|
+
`requestId`, and `action` when reporting API failures.
|
|
153
133
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
- `cloud.assets`: `upload`, `list`, `delete`
|
|
134
|
+
The lifecycle surface also includes `create`, `list`, `get`, `openUrl`, `logs`,
|
|
135
|
+
`followLogs`, and `delete`. Both platforms expose `screenshot`,
|
|
136
|
+
`startRecording`, `listRecordings`, `getRecording`, `stopRecording`, and
|
|
137
|
+
`downloadRecording`; iOS additionally supports `uploadVideo` and
|
|
138
|
+
`uploadMicrophoneAudio`. Inspect the installed types for complete create,
|
|
139
|
+
asset, log, recording, and media options.
|
|
161
140
|
|
|
162
|
-
|
|
163
|
-
`
|
|
141
|
+
In compact form, `cloud.ios`: `create`, `list`, `get`, `openUrl`, `logs`,
|
|
142
|
+
`followLogs`, `screenshot`, and the five recording methods above.
|
|
143
|
+
`cloud.android` provides the same shared lifecycle and control operations.
|
|
164
144
|
|
|
165
|
-
|
|
166
|
-
or Android screenshots. Browser-stream interaction and iframe commands are
|
|
167
|
-
separate from the public SDK.
|
|
145
|
+
## Diagnose App Failures
|
|
168
146
|
|
|
169
|
-
|
|
147
|
+
```bash
|
|
148
|
+
runcloud ios logs "$SESSION_ID" --tail 1000
|
|
149
|
+
runcloud android logs "$SESSION_ID" --tail 1000
|
|
150
|
+
```
|
|
170
151
|
|
|
171
|
-
Use `
|
|
172
|
-
|
|
152
|
+
Use `--follow` while reproducing an issue. Before releasing a failed session,
|
|
153
|
+
capture a bounded retained snapshot; a follow stream contains only new entries.
|
|
173
154
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
permission and loops the decoded audio through `AVAudioEngine`.
|
|
155
|
+
## Connect Local Development
|
|
156
|
+
|
|
157
|
+
Connect a local Metro or mock server through the supported sidecar flow:
|
|
178
158
|
|
|
179
|
-
|
|
159
|
+
```bash
|
|
160
|
+
runcloud ios tunnel "$SESSION_ID" --local-port 8081 --service metro --json
|
|
161
|
+
runcloud ios tunnel-status --json
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Do not expose an unauthenticated third-party tunnel. If the sidecar is
|
|
165
|
+
unavailable, report that requirement instead of guessing a public URL.
|
|
180
166
|
|
|
181
167
|
## Embed a Session
|
|
182
168
|
|
|
183
|
-
-
|
|
184
|
-
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
`
|
|
190
|
-
|
|
191
|
-
`
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
169
|
+
- Use `RemoteControl` from `@run-cloud/ui` with the signed session URL.
|
|
170
|
+
- Its ref exposes promise-based `interact` and convenience methods matching the
|
|
171
|
+
SDK controls. Handle `onInteractionResult` for inspectable acknowledgements.
|
|
172
|
+
- Add `embed=1` to raw iframe URLs. Add `loadingGuard=1` when interaction should
|
|
173
|
+
wait for streaming and app readiness.
|
|
174
|
+
- Raw iframe requests use `run-cloud:interaction`; acknowledgements use
|
|
175
|
+
`run-cloud:interaction-result`. Correlate them by `requestId`. To stop a
|
|
176
|
+
pending request, post `run-cloud:interaction-cancel` with the same
|
|
177
|
+
`requestId` and `action`.
|
|
178
|
+
- Verify `event.source` and the exact signed-URL origin, and use that origin as
|
|
179
|
+
the `postMessage` target.
|
|
180
|
+
- Legacy `ios-simulator:command` messages remain compatibility-only. Prefer the
|
|
181
|
+
generic acknowledged interaction channel for new code.
|
|
182
|
+
- Create a new session after an `ios-simulator:session-restart-requested`
|
|
183
|
+
message; never reuse an ended URL.
|
|
184
|
+
|
|
185
|
+
## Assets, Samples, and Demos
|
|
198
186
|
|
|
199
187
|
```bash
|
|
188
|
+
runcloud sample download ios
|
|
189
|
+
runcloud asset push ./build/MyApp.tar.gz --name my-app --json
|
|
190
|
+
runcloud asset pull <asset-id>
|
|
191
|
+
runcloud ios create --install-asset my-app --json
|
|
200
192
|
runcloud demo run eight-device-mosaic --open
|
|
201
193
|
runcloud demo run live-camera-relay --open
|
|
202
194
|
```
|
|
203
195
|
|
|
204
|
-
|
|
196
|
+
Delete uploaded assets when no longer needed. Bundled demos release their
|
|
197
|
+
sessions automatically.
|
|
205
198
|
|
|
206
199
|
## Guardrails
|
|
207
200
|
|
|
208
|
-
- Release every session created during a task unless
|
|
209
|
-
to keep it open.
|
|
201
|
+
- Release every session created during a task unless asked to keep it open.
|
|
210
202
|
- Use inactivity and hard timeouts for unattended work.
|
|
211
|
-
- Verify platform compatibility before changing
|
|
203
|
+
- Verify artifact/platform compatibility before changing app code after an
|
|
212
204
|
install failure.
|
|
213
205
|
- Do not expose credentials, signed viewer URLs, tunnel URLs, or simulator
|
|
214
206
|
tokens in logs, screenshots, PR comments, or chat output.
|
|
215
|
-
- Do not claim that browser iframe controls are public SDK methods.
|