Skip to content

Commit 14ef90c

Browse files
committed
Document boot and reinstall in website docs and skill
1 parent b5969a5 commit 14ef90c

5 files changed

Lines changed: 46 additions & 5 deletions

File tree

skills/agent-device/SKILL.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,31 @@ npx -y agent-device
2727

2828
## Core workflow
2929

30-
1. Open app or just boot device: `open [app]`
31-
2. Snapshot: `snapshot` to get refs from accessibility tree
32-
3. Interact using refs (`click @ref`, `fill @ref "text"`)
33-
4. Re-snapshot after navigation/UI changes
34-
5. Close session when done
30+
1. Optional preflight in CI: `boot --platform ios|android`
31+
2. Open app or just boot device: `open [app]`
32+
3. Use `reinstall <app> <path>` when you need fresh app state before testing auth/onboarding flows
33+
4. Snapshot: `snapshot` to get refs from accessibility tree
34+
5. Interact using refs (`click @ref`, `fill @ref "text"`)
35+
6. Re-snapshot after navigation/UI changes
36+
7. Close session when done
3537

3638
## Commands
3739

3840
### Navigation
3941

4042
```bash
43+
agent-device boot # Ensure target is booted/ready without opening app
44+
agent-device boot --platform ios # CI preflight for iOS simulator
45+
agent-device boot --platform android # CI preflight for Android device/emulator
4146
agent-device open [app] # Boot device/simulator; optionally launch app
4247
agent-device open [app] --activity com.example/.MainActivity # Android: open specific activity
4348
agent-device close [app] # Close app or just end session
49+
agent-device reinstall <app> <path> # Uninstall + install app in one command
4450
agent-device session list # List active sessions
4551
```
4652

53+
`boot` requires either an active session or an explicit selector (`--platform`, `--device`, `--udid`, or `--serial`).
54+
4755
### Snapshot (page analysis)
4856

4957
```bash
@@ -162,8 +170,10 @@ agent-device apps --platform android --user-installed
162170
- On iOS, `xctest` is the default and does not require Accessibility permission.
163171
- If XCTest returns 0 nodes (foreground app changed), agent-device falls back to AX when available.
164172
- `open <app>` can be used within an existing session to switch apps and update the session bundle id.
173+
- `reinstall <app> <path>` supports Android devices/emulators and iOS simulators in v1.
165174
- If AX returns the Simulator window or empty tree, restart Simulator or use `--backend xctest`.
166175
- Use `--session <name>` for parallel sessions; avoid device contention.
176+
- Use `boot --platform ios|android` as explicit preflight in CI before `open`.
167177
- Use `--activity <component>` on Android to launch a specific activity (e.g. TV apps with LEANBACK).
168178
- Use `fill` when you want clear-then-type semantics.
169179
- Use `type` when you want to append/enter text without clearing.

skills/agent-device/references/session-management.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
## Named sessions
44

55
```bash
6+
agent-device boot --platform ios
67
agent-device --session auth open Settings --platform ios
8+
agent-device --session auth reinstall com.example.app ./build/MyApp.app
79
agent-device --session auth snapshot -i
810
```
911

@@ -14,6 +16,8 @@ Sessions isolate device context. A device can only be held by one session at a t
1416
- Name sessions semantically.
1517
- Close sessions when done.
1618
- Use separate sessions for parallel work.
19+
- Use `boot --platform ios|android` as an explicit readiness check in CI.
20+
- Use `reinstall <app> <path>` for fresh app state instead of manual logout flows.
1721
- For deterministic replay scripts, prefer selector-based actions and assertions.
1822
- Use `replay -u` to update selector drift during maintenance.
1923

website/docs/docs/commands.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,20 @@ This page summarizes the primary command groups.
99
## Navigation
1010

1111
```bash
12+
agent-device boot
13+
agent-device boot --platform ios
14+
agent-device boot --platform android
1215
agent-device open [app]
1316
agent-device close [app]
1417
agent-device back
1518
agent-device home
1619
agent-device app-switcher
1720
```
1821

22+
- `boot` ensures the selected target is ready without launching an app.
23+
- `boot` requires either an active session or an explicit device selector.
24+
- Use `boot --platform ios|android` for CI preflight checks.
25+
1926
## Snapshot and inspect
2027

2128
```bash
@@ -61,6 +68,17 @@ agent-device replay -u ./session.ad # Update selector drift and rewrite .ad sc
6168

6269
See [Replay & E2E (Experimental)](/docs/replay-e2e) for recording and CI workflow details.
6370

71+
## App reinstall (fresh state)
72+
73+
```bash
74+
agent-device reinstall com.example.app ./build/app.apk --platform android
75+
agent-device reinstall com.example.app ./build/MyApp.app --platform ios
76+
```
77+
78+
- `reinstall <app> <path>` uninstalls and installs in one command.
79+
- Supports Android devices/emulators and iOS simulators in v1.
80+
- Useful for login/logout reset flows and deterministic test setup.
81+
6482
## Settings helpers
6583

6684
```bash

website/docs/docs/quick-start.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ title: Quick Start
77
Every device automation follows this pattern:
88

99
```bash
10+
# 0. Optional CI/device preflight
11+
agent-device boot --platform ios # or android
12+
1013
# 1. Navigate
1114
agent-device open SampleApp --platform ios # or android
1215

@@ -26,10 +29,13 @@ agent-device snapshot -i
2629
## Common commands
2730

2831
```bash
32+
agent-device boot --platform ios # Ensure simulator/device is ready
2933
agent-device open SampleApp
3034
agent-device snapshot -i # Get interactive elements with refs
3135
agent-device click @e2 # Click by ref
3236
agent-device fill @e3 "test@example.com" # Clear then type (Android verifies and retries once if needed)
37+
agent-device reinstall com.example.app ./build/MyApp.app --platform ios # Fresh app state (iOS simulator)
38+
agent-device reinstall com.example.app ./build/app.apk --platform android # Fresh app state (Android)
3339
agent-device get text @e1 # Get text content
3440
agent-device screenshot page.png # Save to specific path
3541
agent-device close

website/docs/docs/sessions.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ title: Sessions
77
Sessions keep device state and snapshots consistent across commands.
88

99
```bash
10+
agent-device boot --platform ios
1011
agent-device open Settings --platform ios
1112
agent-device session list
1213
agent-device open Contacts # change app while reusing the default session
@@ -25,5 +26,7 @@ Notes:
2526

2627
- `open <app>` within an existing session switches the active app and updates the session bundle id.
2728
- Use `--session <name>` to run multiple sessions in parallel.
29+
- Use `boot --platform ios|android` as an explicit readiness preflight in CI.
30+
- Use `reinstall <app> <path>` when you need a fresh app state (for example login flows) without manual logout.
2831

2932
For replay scripts and deterministic E2E guidance, see [Replay & E2E (Experimental)](/docs/replay-e2e).

0 commit comments

Comments
 (0)