@swmansion/argent 0.34.1-next.7 → 0.34.1-next.71
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/LICENSE +1 -0
- package/README.md +1 -1
- package/assets/argent.tracecfg.pbtxt +7 -1
- package/assets/ios-screen-stream/Info.plist +12 -0
- package/assets/ios-screen-stream/ios-screen-stream.swift +321 -0
- package/assets/trace-processor/engine_bundle.node.js +2074 -11121
- package/assets/trace-processor/trace_processor.wasm +0 -0
- package/bin/argent-android-devtools-0.4.0.apk +0 -0
- package/bin/darwin/argent-macos-helper +0 -0
- package/bin/darwin/ax-service +0 -0
- package/bin/darwin/simulator-server +0 -0
- package/bin/darwin/tvos-ax-service +0 -0
- package/bin/darwin/tvos-hid-daemon +0 -0
- package/bin/linux/simulator-server +0 -0
- package/bin/linux-arm64/simulator-server +0 -0
- package/bin/network-inspector/network-inspector.jar +0 -0
- package/bin/tcp/ax-service +0 -0
- package/bin/win32/simulator-server.exe +0 -0
- package/dist/cli-cmds.mjs +1259 -616
- package/dist/client.js +381 -180
- package/dist/flow-script-runner.mjs +1 -0
- package/dist/installer-help.js +4 -0
- package/dist/installer-help.js.map +1 -1
- package/dist/installer.mjs +1248 -898
- package/dist/ios-device-runner/ArgentRunner/ArgentRunner.xcodeproj/xcshareddata/xcschemes/ArgentRunner.xcscheme +1 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentLaunchPerformanceTests.swift +21 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession+Commands.swift +9 -3
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/ArgentRunnerSession.swift +3 -0
- package/dist/ios-device-runner/ArgentRunner/ArgentRunnerUITests/RunnerHTTPServer.swift +21 -9
- package/dist/mcp-server.mjs +2675 -715
- package/dist/preview-ui/index.html +28 -2
- package/dist/tool-args.generated.d.ts +101 -33
- package/dist/tool-server.cjs +15873 -6272
- package/dylibs/libArgentAudio.dylib +0 -0
- package/dylibs/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/libKeyboardPatch.dylib +0 -0
- package/dylibs/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/macos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/macos/libNativeDevtoolsMacos.dylib +0 -0
- package/dylibs/tcp/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tcp/libKeyboardPatch.dylib +0 -0
- package/dylibs/tcp/libNativeDevtoolsIos.dylib +0 -0
- package/dylibs/tvos/libArgentInjectionBootstrap.dylib +0 -0
- package/dylibs/tvos/libKeyboardPatch.dylib +0 -0
- package/dylibs/tvos/libNativeDevtoolsIos.dylib +0 -0
- package/package.json +1 -1
- package/rules/argent.md +6 -23
- package/skills/argent-android-emulator-setup/SKILL.md +4 -4
- package/skills/argent-create-e2e/SKILL.md +3 -0
- package/skills/argent-create-e2e/references/e2e-yaml.md +20 -2
- package/skills/argent-create-e2e/references/live-authoring.md +12 -1
- package/skills/argent-device-interact/SKILL.md +22 -21
- package/skills/argent-device-interact/references/foldables.md +22 -0
- package/skills/argent-ios-device-interact/SKILL.md +3 -3
- package/skills/argent-ios-device-setup/SKILL.md +4 -2
- package/skills/argent-macos-app-interact/SKILL.md +15 -5
- package/skills/argent-macos-app-interact/references/e2e.md +1 -1
- package/skills/argent-metro-debugger/SKILL.md +26 -14
- package/skills/argent-native-profiler/SKILL.md +14 -2
- package/skills/argent-qa-e2e/SKILL.md +1 -1
- package/skills/argent-react-native-app-workflow/SKILL.md +2 -2
- package/skills/argent-react-native-optimization/SKILL.md +10 -1
- package/skills/argent-react-native-optimization/references/fix-reference.md +10 -10
- package/skills/argent-react-native-profiler/SKILL.md +4 -3
- package/skills/argent-screen-recording/SKILL.md +6 -4
- package/skills/argent-screenshot-diff/SKILL.md +1 -1
- package/skills/argent-test-ui-flow/SKILL.md +1 -1
- package/skills/argent-tv-interact/SKILL.md +3 -3
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swmansion/argent",
|
|
3
|
-
"version": "0.34.1-next.
|
|
3
|
+
"version": "0.34.1-next.71",
|
|
4
4
|
"mcpName": "io.github.software-mansion/argent",
|
|
5
5
|
"description": "MCP server for iOS Simulator, Android Emulator, Chromium app and Mac app control",
|
|
6
6
|
"license": "Apache-2.0",
|
package/rules/argent.md
CHANGED
|
@@ -1,34 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
description:
|
|
2
|
+
description: What to do when this project uses Argent but Argent is not available in this environment
|
|
3
3
|
alwaysApply: true
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Argent
|
|
6
|
+
This project uses Argent, through its `argent` MCP server, to drive, test and profile apps on simulators, emulators, phones, TVs and Chromium. The server's own instructions carry the usage guidance.
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
- use the platform the user named; otherwise prefer a device `list-devices` shows already running, and don't default to iOS; in a single-platform project boot that platform.
|
|
10
|
-
- if tap fails twice, stop retrying and re-run a discovery tool
|
|
11
|
-
- Prefer mcp-tool calls over raw commands like `xcrun` or `adb`; use them as fallback.
|
|
12
|
-
- Interaction tools return screenshot and element tree automatically; an identical earlier tree is named by its tree id, not repeated.
|
|
13
|
-
- prefer `launch-app` or `open-url` than tapping icons on home screen.
|
|
14
|
-
- If a task can require a saved e2e test, load `argent-create-e2e` (`argent-qa-e2e` for acceptance tests) before the first launch or in-app action; recording is not retroactive.
|
|
15
|
-
- Load the matching `argent-*` skill before React Native build/debug, profiling, a physical phone, a Mac app or a TV.
|
|
16
|
-
- Do not stop simulator servers when a task finishes: the next task reuses them. Call `stop-all-simulator-servers` when the user asks to clean up or ends the session, or when a skill tells you to recycle a device's services, with devices this session used. One tool-server is shared by every other agent, so unscoped call tears down their devices too. Never stop a Metro the user started unless they ask.
|
|
17
|
-
- Use the `await-ui-element` tool to block until the UI settles instead of polling using screenshot.
|
|
18
|
-
- The `argent` CLI manages the toolkit: `argent --help` lists commands, `argent --version` shows the installed version.
|
|
8
|
+
Check once per session whether argent is available; do not re-probe before later calls:
|
|
19
9
|
|
|
20
|
-
|
|
21
|
-
Run this check once per session. Do not re-probe before later calls.
|
|
22
|
-
Confirm argent is available:
|
|
23
|
-
|
|
24
|
-
1. Are `mcp__argent__*` tools in your tool list? If none, argent is not available.
|
|
10
|
+
1. Are argent tools (such as `mcp__argent__*`) in your tool list? If none, argent is not available.
|
|
25
11
|
2. If unsure, run `command -v argent`. Non-zero exit = the CLI is not on PATH.
|
|
26
12
|
|
|
27
|
-
If argent
|
|
13
|
+
If argent is available, ignore this rule.
|
|
28
14
|
|
|
29
|
-
If argent is
|
|
30
|
-
Tell the user once, and ask if you should continue without argent:
|
|
15
|
+
If argent is absent, treat it as an expected state, not an error to retry. Do not call argent tools, run `argent` commands or attempt any argent workflow. Tell the user once, and ask if you should continue without argent:
|
|
31
16
|
|
|
32
17
|
> Argent isn't installed in this environment. To enable the mobile/Chromium tooling this repo is configured for, run `npx @swmansion/argent@latest init -y` (or `npm i -g @swmansion/argent@latest && argent init -y`).
|
|
33
|
-
|
|
34
|
-
</availability_check>
|
|
@@ -5,12 +5,12 @@ description: Set up and connect to an Android emulator using argent MCP tools. U
|
|
|
5
5
|
|
|
6
6
|
## 1. Prerequisites
|
|
7
7
|
|
|
8
|
-
The Android SDK (platform tools and emulator) and an AVD, created in Android Studio or with `avdmanager create avd`. If `list-devices` returns no Android
|
|
8
|
+
The Android SDK (platform tools and emulator) and an AVD, created in Android Studio or with `avdmanager create avd`. If `list-devices` returns no Android entries, either no AVD exists or Argent can't find the SDK. Then run `argent config set android.sdkRoot <sdk-path>` and call `list-devices` again after a minute: a failed SDK lookup is cached that long. Exporting `ANDROID_HOME` in your shell doesn't reach the tool-server that is already running.
|
|
9
9
|
|
|
10
10
|
## 2. Setup
|
|
11
11
|
|
|
12
|
-
1. **Find a ready device**: call `list-devices`. Filter for entries with `platform: "android"`. Ready devices (`state: "device"`) come first. If the user named a device, use it. Otherwise pick the first `kind: "emulator"` that fits the task. Take a physical phone (`kind: "device"`) only when the user asks for one. If the result
|
|
13
|
-
2. **Boot if needed**: if no such emulator is ready, call `boot-device` with `avdName:
|
|
12
|
+
1. **Find a ready device**: call `list-devices`. Filter for entries with `platform: "android"`. Ready devices (`state: "device"`) come first. If the user named a device, use it. Otherwise pick the first `kind: "emulator"` that fits the task. Take a physical phone (`kind: "device"`) only when the user asks for one. If the result's `notes` mention the adb server, prefix every `adb` command that you run yourself, as the note shows.
|
|
13
|
+
2. **Boot if needed**: if no such emulator is ready, call `boot-device` with the `avdName` of a `kind: "avd"` entry. It returns the serial; pass that serial as `udid` to argent tools. An `avd` entry doesn't mark TV images: for a TV task, pick the AVD by its name.
|
|
14
14
|
|
|
15
15
|
## 3. Using the device
|
|
16
16
|
|
|
@@ -18,5 +18,5 @@ Pass the Android serial as `udid` to the same interaction tools as on iOS. See `
|
|
|
18
18
|
|
|
19
19
|
## 4. Notes
|
|
20
20
|
|
|
21
|
-
- **Android TV / leanback AVDs** boot through this exact flow, but `list-devices` tags them `runtimeKind: "tv"` and they are focus-driven: use the `argent-tv-interact` skill, not the gesture tools.
|
|
21
|
+
- **Android TV / leanback AVDs** boot through this exact flow, but once running `list-devices` tags them `runtimeKind: "tv"` and they are focus-driven: use the `argent-tv-interact` skill, not the gesture tools.
|
|
22
22
|
- To stop the emulator, run `adb -s <serial> emu kill` from a shell (clean shutdown). Never `pkill -9`/`kill -9` qemu: a hard kill leaves the userdata image dirty, after which cold boots can hang for many minutes doing recovery (runaway writes, `boot_completed` never flips). If an image gets into that state, boot once with `-wipe-data` to reset it.
|
|
@@ -39,6 +39,9 @@ During polish, use `within`, `after`, and `next` to disambiguate repeated elemen
|
|
|
39
39
|
1. Choose the e2e test type:
|
|
40
40
|
- **standalone:** the first step that is not `echo:` or `script:` is `launch:`. The test controls process start.
|
|
41
41
|
- **fragment:** there is no leading launch. Declare a precise `executionPrerequisite`.
|
|
42
|
+
|
|
43
|
+
When a test needs the state that an earlier test leaves, put both in a [suite](references/e2e-yaml.md#suites).
|
|
44
|
+
|
|
42
45
|
2. Follow [Live authoring](references/live-authoring.md): start, record one verified step at a time, finish, polish, audit, and replay.
|
|
43
46
|
3. Report the file, replay command, result, prerequisite or side effects, and every coordinate or raw-gesture exception.
|
|
44
47
|
|
|
@@ -16,6 +16,7 @@ Read this reference when polishing, composing, or manually reviewing an e2e test
|
|
|
16
16
|
- [Composition and platform limits](#composition-and-platform-limits)
|
|
17
17
|
- [Local scripts](#local-scripts)
|
|
18
18
|
- [Snapshots and CLI runs](#snapshots-and-cli-runs)
|
|
19
|
+
- [Suites](#suites)
|
|
19
20
|
- [YAML safety](#yaml-safety)
|
|
20
21
|
|
|
21
22
|
## File shape and test type
|
|
@@ -38,7 +39,7 @@ executionPrerequisite: User is signed in and viewing Settings
|
|
|
38
39
|
steps: []
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
The recorder also writes `version:
|
|
42
|
+
The recorder also writes `version: 2`, the file format version. Keep it. A file without it is version 1, and a version newer than the installed Argent reads is refused. Do not change the version of an existing file: on an iOS simulator with a landscape UI, version 1 coordinates use the portrait axes of the screen and version 2 coordinates the UI as the user sees it, and Argent runs each as it was recorded.
|
|
42
43
|
|
|
43
44
|
E2E tests never store a device id. The runner binds the device. `launch:` restarts the process but does not clear app, account, or backend data.
|
|
44
45
|
|
|
@@ -119,7 +120,7 @@ Directives stop the test on failure and skip later steps. The available directiv
|
|
|
119
120
|
|
|
120
121
|
- The coordinates change with the panel. Selectors resolve against a new tree.
|
|
121
122
|
- A `snapshot` baseline is valid only for the posture that made it.
|
|
122
|
-
- iOS: unfolded, the UI is landscape. `swipe` and `scroll-to` directions
|
|
123
|
+
- iOS: unfolded, the UI is landscape. `swipe` and `scroll-to` directions, the reading order and coordinates stay as the user sees the UI, the space of `describe` frames and screenshots.
|
|
123
124
|
- iOS: a fold between two angles that are not `closed` or `open` can keep the current panel. The step passes, and the report names the panel. To change panels, fold to `closed` or `open`.
|
|
124
125
|
|
|
125
126
|
Use the launch map for cross-platform tests. A bare launch applies everywhere and becomes an app path on Chromium. The map takes `native:`, `ios:`, `android:`, `vega:`, `macos:`, and `chromium:`. `native:` is one id shared by iOS, Android, Vega, and macOS, and a per-platform key overrides it for that platform. `macos:` takes a Mac app's bundle id. `chromium:` accepts a relative or absolute app path. `ios:` and `macos:` also accept `{ app, args }`; Argent passes `args` to the app at launch. A launch that declares no id for the run's platform is an error, not a cue to switch platforms. A run on a remote simulator uses the `ios:` id, or the `native:` id when the map has no `ios:` key, so no test needs a key for a remote run. On an iOS simulator, a successful launch also pins later tree reads to that app until the next raw `tool:` step, so read [The runner tree is not the discovery tree](#the-runner-tree-is-not-the-discovery-tree) when a read describes the wrong screen.
|
|
@@ -278,6 +279,23 @@ Baselines live beside the test, under `.argent/e2e/__baselines__/<name>/` and ar
|
|
|
278
279
|
|
|
279
280
|
Pin `--platform` and `--device` for iOS, Android, or Vega. For Chromium the device class is the window's own pixel size, which the app sets and no launch argument changes: pass `--platform chromium` and omit `--device` so the runner boots the declared app path instead of attaching to a running window of another size. A window sized from host or session state produces a key CI cannot reproduce, and the step fails for a missing baseline. For a Mac app, pass `--platform macos` and omit `--device`; the key holds the window size in points, so a new window size needs new baselines. The runner pins mobile status bars during visual runs. `--output <dir>` writes failed snapshots' images and failed steps' screenshots under `<dir>/<name>/` for CI artifact upload.
|
|
280
281
|
|
|
282
|
+
### Suites
|
|
283
|
+
|
|
284
|
+
`argent e2e run <dir> [--recursive]` runs the tests of a directory. They are independent, and their order is not guaranteed. When a test needs the state that an earlier test leaves, make the directory a suite: add `suite.config.yaml` beside the tests.
|
|
285
|
+
|
|
286
|
+
```yaml
|
|
287
|
+
continueOnFailure: false # optional; true runs the later tests after a failure
|
|
288
|
+
tests: # optional; default is file name order
|
|
289
|
+
- add-post
|
|
290
|
+
- delete-post
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
- A failed test skips the later tests of its suite (`skipped (earlier test failed)`). A `requires:` skip is not a failure.
|
|
294
|
+
- With `tests:`, a test file in the directory that the list does not name does not run, and the run warns.
|
|
295
|
+
- A suite holds only the test files directly in its directory. A subdirectory is a separate suite only with its own `suite.config.yaml`.
|
|
296
|
+
- Quote a test name that YAML reads as a number or boolean: `- "2024"`.
|
|
297
|
+
- An invalid file skips every test of its suite and the run exits 1. A run of one test ignores the file, so a test that needs the state of an earlier test fails alone: replay the suite directory.
|
|
298
|
+
|
|
281
299
|
## YAML safety
|
|
282
300
|
|
|
283
301
|
Quote strings containing `#`, `:`, or quotes. Quote numbers and `true` or `false` in text slots. Use single quotes for regexes with backslashes. Parsing rejects invalid directives, selectors, regexes, `else`, unsupported options, and standalone tests that also declare `executionPrerequisite`.
|
|
@@ -15,6 +15,7 @@ Read this file before creating or changing an e2e test. Exercise the saved path
|
|
|
15
15
|
- [Typing](#typing)
|
|
16
16
|
- [Scrolling and swiping](#scrolling-and-swiping)
|
|
17
17
|
- [Live waits and checks](#live-waits-and-checks)
|
|
18
|
+
- [Network capture](#network-capture)
|
|
18
19
|
- [Wrong turns](#wrong-turns)
|
|
19
20
|
- [Finish and polish](#finish-and-polish)
|
|
20
21
|
- [Worked example](#worked-example)
|
|
@@ -143,6 +144,16 @@ The live tool and e2e runner use [different trees](e2e-yaml.md#the-runner-tree-i
|
|
|
143
144
|
|
|
144
145
|
A warning does not reject the step. If `e2e-finish-recording` reports dropped warnings, record those waits again. Replay every conversion. Keep a raw tool only for `pollIntervalMs`, `bundleId`, or a cross-tree mismatch.
|
|
145
146
|
|
|
147
|
+
### Network capture
|
|
148
|
+
|
|
149
|
+
On iOS and Android, `view-network-logs` and `native-network-logs` only read. On a Mac app, `native-network-logs` only reads. Before `network-capture-start`, they say that capture is not started. A `tool:` step passes whatever text it returns, so a read before a start replays green and proves nothing.
|
|
150
|
+
|
|
151
|
+
1. Record `network-capture-start` through `e2e-add-step` after the launch and its first-screen wait, before the action whose requests the test reads. A launch ends the capture of the JS layer. A start before `launch:` makes the test a fragment.
|
|
152
|
+
2. Before a recorded `network-capture-stop`, record a wait for the screen that shows the result of the request. Argent records no request that the app sends after the stop.
|
|
153
|
+
3. If a read says that capture is not started, do not answer it with a direct `network-capture-start` call: the replay does not have that call. Record the start, then record the action and the read again.
|
|
154
|
+
4. A `tool:` step keeps its recorded `bundleId` on every platform. Only `launch:` takes an id per platform. If the app id differs by platform, add a top-level `requires:` block with the recording platform (see [File shape and test type](e2e-yaml.md#file-shape-and-test-type)). Record a separate test for each other platform.
|
|
155
|
+
5. A `tool: network-capture-start` or `tool: network-capture-stop` step passes whatever its `armed` says. A start that armed no layer passes, and so does a stop whose JS layer stays `armed: true`. After each replay, read `armed` and `reason` of each layer in the step's `result`. If the start did not arm the layer that the test reads, or the stop did not disarm it, the reads after it prove nothing.
|
|
156
|
+
|
|
146
157
|
### Wrong turns
|
|
147
158
|
|
|
148
159
|
Stop immediately. Restore the last valid screen with direct MCP calls, not `e2e-add-step`. Continue only from verified state. Remove the bad step after finishing. If recovery changed or skipped meaningful behavior, re-record that portion live.
|
|
@@ -195,7 +206,7 @@ e2e-finish-recording { TEST }
|
|
|
195
206
|
After meaning-preserving conversion:
|
|
196
207
|
|
|
197
208
|
```yaml
|
|
198
|
-
version:
|
|
209
|
+
version: 2
|
|
199
210
|
steps:
|
|
200
211
|
- echo: Restart Acme Notes. Expect Home
|
|
201
212
|
- launch: com.acme.notes
|
|
@@ -16,27 +16,28 @@ Each tool's own description carries its parameters, defaults, return shape and e
|
|
|
16
16
|
|
|
17
17
|
## 2. Choosing the Right Tool
|
|
18
18
|
|
|
19
|
-
| Action | Tool
|
|
20
|
-
| ------------------------------ |
|
|
21
|
-
| Several known steps | `run-sequence`
|
|
22
|
-
| Open an app | `launch-app`
|
|
23
|
-
| Restart an app | `restart-app`
|
|
24
|
-
| Open URL / deep link | `open-url`
|
|
25
|
-
| Tap | `gesture-tap`
|
|
26
|
-
| Scroll / swipe | `gesture-swipe`
|
|
27
|
-
| Scroll (Chromium) | `gesture-scroll`
|
|
28
|
-
| Drag (Chromium) | `gesture-drag`
|
|
29
|
-
| Long press, drag & drop | `gesture-custom`
|
|
30
|
-
| Pinch / zoom | `gesture-pinch`
|
|
31
|
-
| Two-finger rotation | `gesture-rotate`
|
|
32
|
-
| Hardware key | `button`
|
|
33
|
-
| Type text or press a named key | `keyboard`
|
|
34
|
-
| Paste text | `paste`
|
|
35
|
-
| Rotate device | `rotate`
|
|
36
|
-
| Fold device | `fold`
|
|
37
|
-
| Shake device | `shake`
|
|
38
|
-
|
|
|
39
|
-
| Wait for
|
|
19
|
+
| Action | Tool | Notes |
|
|
20
|
+
| ------------------------------ | -------------------- | ------------------------------------------------------------------------ |
|
|
21
|
+
| Several known steps | `run-sequence` | One call, one screenshot at the end (§5) |
|
|
22
|
+
| Open an app | `launch-app` | **Never tap home-screen icons** |
|
|
23
|
+
| Restart an app | `restart-app` | Clean in-memory state |
|
|
24
|
+
| Open URL / deep link | `open-url` | Web pages, deep links, URL schemes |
|
|
25
|
+
| Tap | `gesture-tap` | Buttons, links, checkboxes |
|
|
26
|
+
| Scroll / swipe | `gesture-swipe` | Touch targets; not Chromium |
|
|
27
|
+
| Scroll (Chromium) | `gesture-scroll` | Mouse wheel |
|
|
28
|
+
| Drag (Chromium) | `gesture-drag` | Sliders, drag-and-drop, text selection |
|
|
29
|
+
| Long press, drag & drop | `gesture-custom` | Also any other non-linear touch sequence |
|
|
30
|
+
| Pinch / zoom | `gesture-pinch` | |
|
|
31
|
+
| Two-finger rotation | `gesture-rotate` | |
|
|
32
|
+
| Hardware key | `button` | Home, back, power, volume, appSwitch, actionButton |
|
|
33
|
+
| Type text or press a named key | `keyboard` | Every platform; text or one key per call (§6) |
|
|
34
|
+
| Paste text | `paste` | Only where a user would paste (§6). Sim/emu, Mac app |
|
|
35
|
+
| Rotate device | `rotate` | Orientation changes |
|
|
36
|
+
| Fold device | `fold` | Foldables only: `references/foldables.md` |
|
|
37
|
+
| Shake device | `shake` | Shake handlers (sim/emu only), Undo-typing prompt, RN dev menu |
|
|
38
|
+
| Slow or offline network | `network-conditions` | Latency, bandwidth, offline. iOS sim app, Chromium tab; Android: offline |
|
|
39
|
+
| Wait for UI | `await-ui-element` | Block until an element is visible/hidden/exists/contains text |
|
|
40
|
+
| Wait for idle | `await-screen-idle` | Block until a non-empty tree holds for `minStableMs` (§4) |
|
|
40
41
|
|
|
41
42
|
## 3. Finding Tap Targets
|
|
42
43
|
|
|
@@ -6,3 +6,25 @@ Read this for a device `list-devices` marks `foldable: true`: a foldable iOS sim
|
|
|
6
6
|
- Fold between gestures, not during one. A gesture stays on the panel where it started.
|
|
7
7
|
- iOS: if argent cannot find the active panel, it uses the cover panel and sets `warning` (a screenshot-diff summary gets a `panel:` line). Take a screenshot to see what the device shows, then do the check the warning names.
|
|
8
8
|
- Android: on a closed generic foldable AVD, tap only full-width rows; test the cover panel on a Pixel Fold AVD.
|
|
9
|
+
|
|
10
|
+
## Move a full-screen app into Split View on iPhone Duo
|
|
11
|
+
|
|
12
|
+
Start with the Duo open in landscape and the app full screen. If needed, use `fold` to open the Duo and `launch-app` to open the app.
|
|
13
|
+
|
|
14
|
+
Call `gesture-custom` once with the Duo UDID and these parameters to move the app to the **left**. The `edge` field tells iOS that the touch starts a system gesture. Keep the finger down through the pause and the sideways drag.
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"edge": "bottom",
|
|
19
|
+
"interpolate": 12,
|
|
20
|
+
"events": [
|
|
21
|
+
{ "type": "Down", "x": 0.5, "y": 1 },
|
|
22
|
+
{ "type": "Move", "x": 0.5, "y": 0.5, "delayMs": 280 },
|
|
23
|
+
{ "type": "Move", "x": 0.5, "y": 0.5, "delayMs": 300 },
|
|
24
|
+
{ "type": "Move", "x": 0.14, "y": 0.5, "delayMs": 320 },
|
|
25
|
+
{ "type": "Up", "x": 0.14, "y": 0.5, "delayMs": 200 }
|
|
26
|
+
]
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
For the **right**, change both final x coordinates to `0.86`. Check the screenshot for the app on the requested side and the Home Screen on the other. Stop here if the user asked for one app at half width.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-ios-device-interact
|
|
3
|
-
description: Drive a physical iPhone through argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator. For
|
|
3
|
+
description: Drive a physical iPhone through argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator. For connection, trust, or signing problems read argent-ios-device-setup.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Physical iPhone interaction
|
|
@@ -15,5 +15,5 @@ Read this only for a physical iPhone. `argent-device-interact` still applies for
|
|
|
15
15
|
|
|
16
16
|
## Tools on hardware
|
|
17
17
|
|
|
18
|
-
- Only these exist: `list-devices`, `launch-app`, `restart-app`, `reinstall-app`, `open-url`, `describe`, `screenshot`, `screenshot-diff`, `gesture-tap`, `gesture-swipe`, `gesture-custom`, `gesture-pinch`, `gesture-rotate`, `button` (`home`, `volumeUp`, `volumeDown`, `actionButton` on models that have one), `keyboard`, `await-ui-element`, `await-screen-idle`, `run-sequence`, the e2e tools, `stop-simulator-server` and `stop-all-simulator-servers` (session end). Every other device tool fails with `not supported on ios device`.
|
|
19
|
-
- No `rotate` (the orientation tool), `shake`, `paste`, `settings-permissions`,
|
|
18
|
+
- Only these exist: `list-devices`, `launch-app`, `restart-app`, `reinstall-app`, `open-url`, `describe`, `screenshot`, `screenshot-diff`, `gesture-tap`, `gesture-swipe`, `gesture-custom`, `gesture-pinch`, `gesture-rotate`, `button` (`home`, `volumeUp`, `volumeDown`, `actionButton` on models that have one), `keyboard`, `await-ui-element`, `await-screen-idle`, `run-sequence`, `screen-recording-start` and `screen-recording-stop` on a cabled phone (`argent-screen-recording`), the e2e tools, `stop-simulator-server` and `stop-all-simulator-servers` (session end), and for launch time `native-profiler-launch-analysis` with `profiler-load` and `profiler-stack-query` on its session (`argent-native-profiler` §4). Every other device tool fails with `not supported on ios device`.
|
|
19
|
+
- No `rotate` (the orientation tool), `shake`, `paste`, `settings-permissions`, `debugger-*`, `react-profiler-*`, `native-*` other than `native-profiler-launch-analysis`, `boot-device`: move the phone by hand, type with `keyboard`, change permissions in the phone's Settings, and debug or profile on a simulator.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-ios-device-setup
|
|
3
|
-
description: Set up a
|
|
3
|
+
description: Set up a physical iPhone over USB or a connected CoreDevice tunnel for argent. Use when a physical iPhone is involved (a list-devices iOS entry with kind "device") and ONLY then; never for a simulator.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Physical iPhone setup
|
|
@@ -9,7 +9,7 @@ Read this only for a physical iPhone. Simulators use `argent-ios-simulator-setup
|
|
|
9
9
|
|
|
10
10
|
## First run
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. Connect the phone in Xcode through USB or a CoreDevice network tunnel. Unlock it, keep the screen awake, and enable Developer Mode (Settings > Privacy & Security > Developer Mode). `list-devices` must show it `connected`; `paired` means unreachable. A network phone's tunnel comes up on its first call. A fleet provider must expose the CoreDevice tunnel to this Mac.
|
|
13
13
|
2. `launch-app` only registers the app. The first `describe`, gesture or `screenshot` builds, signs and starts the on-device runner: minutes cold, tens of seconds from cache or after a tool-server restart. Build cap 15 min, runner ready 120 s.
|
|
14
14
|
3. On the first install the phone asks to trust the developer (Settings > General > VPN & Device Management), and an **Argent Runner** app appears on the home screen. Tell the user it is argent's automation runner and must stay installed.
|
|
15
15
|
|
|
@@ -17,4 +17,6 @@ Read this only for a physical iPhone. Simulators use `argent-ios-simulator-setup
|
|
|
17
17
|
|
|
18
18
|
Signing needs no configuration: the first call on a phone names the team it picked; `ARGENT_IOS_TEAM_ID` in the tool-server environment overrides it. Errors name their fix (cable, lock, trust, signing, a stuck runner): apply it and retry the same call. A failed build quotes xcodebuild's own `error:` lines.
|
|
19
19
|
|
|
20
|
+
For a network device, a missing tunnel requires reconnecting in Xcode or through its fleet provider. If the runner stops answering on its tunnel, Argent restarts it on the current address and retries the call once.
|
|
21
|
+
|
|
20
22
|
Then read `argent-ios-device-interact`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-macos-app-interact
|
|
3
|
-
description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos) through argent. Use when a list-devices entry has platform "macos", or the user names a Mac app, a macOS app or a native desktop app. Never for an iOS simulator, an iPhone, or an Electron or Chromium app (platform "chromium").
|
|
3
|
+
description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos, Mac Catalyst) through argent. Use when a list-devices entry has platform "macos", or the user names a Mac app, a macOS app or a native desktop app. Never for an iOS simulator, an iPhone, or an Electron or Chromium app (platform "chromium").
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
`argent-device-interact` still applies for everything not listed here (`run-sequence`, `await-ui-element`, secrets).
|
|
@@ -23,6 +23,7 @@ description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos) throug
|
|
|
23
23
|
- Swipe or drag: `gesture-drag`. Long press: `gesture-drag` with the same start and end point. Scroll: `gesture-scroll`.
|
|
24
24
|
- Zoom or rotate: `gesture-pinch` and `gesture-rotate` fail; use the app's own controls or shortcuts.
|
|
25
25
|
- After a right-click (`gesture-tap` with `button: "right"`), the returned tree lists the menu items; a plain `gesture-tap` on one chooses it (the menu can stay in the tree for a moment while it closes). `keyboard` `escape` closes the menu; `enter` chooses nothing after a right-click, so tap the item.
|
|
26
|
+
- For a Command-click or Shift-click, pass `modifiers` in the `gesture-tap` call. Check the returned tree for the expected selection.
|
|
26
27
|
- No hover: a tooltip is out of reach.
|
|
27
28
|
- `open-url`: the URL goes to the running app. A custom scheme must be one the app declares; `http` and `https` go to the app, not the browser; a `file:` URL opens that document in the app.
|
|
28
29
|
- A SwiftUI `DisclosureGroup` opens only at its chevron, near the left end of its frame: a tap at the centre passes and does nothing. Tap along the left end in steps of about 0.008 until its `value` changes.
|
|
@@ -31,18 +32,27 @@ description: Drive a native Mac app (AppKit, SwiftUI, react-native-macos) throug
|
|
|
31
32
|
|
|
32
33
|
## Tree
|
|
33
34
|
|
|
34
|
-
- Identifiers: AppKit
|
|
35
|
+
- Identifiers: AppKit and UIKit `accessibilityIdentifier`, SwiftUI `.accessibilityIdentifier()`, web `data-testid` (else `id`), React Native `testID` (also on a plain `View` or `Text` in react-native-macos).
|
|
35
36
|
- Hint `The Mac is locked` or `fallback walk`: clicks and typing still work, elements can be missing (an open context menu among them), and a `hidden` check cannot pass. Ask the user to unlock when a target is missing.
|
|
36
37
|
- An action that fails or has no effect: a minimized window takes no input. Restore it by choosing it in the Window menu with `menu-bar`; without such an item, ask the user.
|
|
37
38
|
|
|
39
|
+
## Mac Catalyst (kind `catalyst`)
|
|
40
|
+
|
|
41
|
+
- Build with `xcodebuild -scheme <scheme> -destination 'platform=macOS,variant=Mac Catalyst' build`. Add `-workspace <name>.xcworkspace` for a workspace (React Native, CocoaPods), or `-project <name>.xcodeproj` to select a project. Without `-scheme`, xcodebuild ignores the destination and builds for iOS. A Debug build is in DerivedData under `Build/Products/Debug-maccatalyst/`, not `Debug-iphonesimulator/`. Pass that `.app` to `boot-device`. If it reports "Designed for iPad", ask for the Mac Catalyst build or suggest testing on an iOS simulator.
|
|
42
|
+
- Use `describe` to find UIKit controls and their frames. AppKit view-tree tools are unavailable.
|
|
43
|
+
- Switch to the intended window with `menu-bar` and the Window menu. Tap the target field before typing, since keyboard focus can be in another window and SwiftUI Tab order can differ from the visible order.
|
|
44
|
+
- Tap alert buttons directly. Return depends on a default action, and Escape can leave a UIKit text-field alert open.
|
|
45
|
+
- Find toolbar menu buttons by label if **Optimize Interface for Mac** leaves them without identifiers.
|
|
46
|
+
- If typing, paste, or scrolling reports success without changing the app, check whether the installed native library supports Mac Catalyst input.
|
|
47
|
+
|
|
38
48
|
## Profiling
|
|
39
49
|
|
|
40
|
-
Use `argent-native-profiler` for native profiling or `argent-react-native-profiler` to capture React performance on a react-native-macos app. Instruments can pause the app during leak checks, delaying actions and inspection. After `MACOS_APP_RPC_TIMEOUT`, use `describe` before retrying because the action may already have taken effect.
|
|
50
|
+
Use `argent-native-profiler` for native profiling or `argent-react-native-profiler` to capture React performance on a react-native-macos or Mac Catalyst React Native app. Instruments can pause the app during leak checks, delaying actions and inspection. After `MACOS_APP_RPC_TIMEOUT`, use `describe` before retrying because the action may already have taken effect.
|
|
41
51
|
|
|
42
52
|
## E2E tests
|
|
43
53
|
|
|
44
54
|
Read `references/e2e.md` before recording or writing a test for a Mac app.
|
|
45
55
|
|
|
46
|
-
##
|
|
56
|
+
## React Native
|
|
47
57
|
|
|
48
|
-
|
|
58
|
+
For React Native Debug builds on macOS, including Mac Catalyst, start Metro before `boot-device` (see `argent-react-native-app-workflow`). Use `describe` for UI targets. For JavaScript debugging and network capture, follow the Mac app workflow in `argent-metro-debugger`.
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
- Record the launch as a `restart-app` step, then write it as `launch: { macos: <bundle id> }` (keep `{ app, args }` if the recorder wrote args) so the runner picks the Mac app and starts it. Otherwise run with `--platform macos` or the device id: without them the runner never picks a Mac app.
|
|
4
4
|
- A `swipe` is a mouse drag, a `long-press` a press and hold. `pinch` and `rotate` fail.
|
|
5
|
-
- A right-click is `tap: { on: <selector>, button: right }`.
|
|
5
|
+
- A right-click is `tap: { on: <selector>, button: right }`. For a Command-click, write `tap: { on: <selector>, modifiers: [command] }`. The recorder preserves `modifiers` from `gesture-tap` so replay holds the same keys.
|
|
6
6
|
- A file panel is a `tool: file-panel` step, a menu command a `tool: menu-bar` step (`args: { action: choose, path: [Edit, Select All] }`). Gate a branch with `when: { platform: macos }`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-metro-debugger
|
|
3
|
-
description: Debug
|
|
3
|
+
description: Debug JavaScript with Argent in React Native apps on iOS, Android, Vega, and macOS, or in Chromium and Electron over CDP. Use when connecting to a runtime, inspecting React components, reading console logs, or evaluating JavaScript.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## 1. Prerequisites
|
|
@@ -8,28 +8,40 @@ description: Debug a JS runtime via CDP using argent debugger tools. Primary pat
|
|
|
8
8
|
Physical iPhone: not supported; every `debugger-*` tool rejects `kind: "device"`.
|
|
9
9
|
|
|
10
10
|
- **React Native (iOS / Android)**: Metro running (default `localhost:8081`) and the app connected to it. Verify with `debugger-status`.
|
|
11
|
-
- **Android**: a physical device, a TV emulator, or a dev client that loads from `localhost` needs `adb -s <serial> reverse tcp:<port> tcp:<port>` (default 8081). If `list-devices` returns a
|
|
11
|
+
- **Android**: a physical device, a TV emulator, or a dev client that loads from `localhost` needs `adb -s <serial> reverse tcp:<port> tcp:<port>` (default 8081). If `list-devices` returns a note about the adb server, prefix the command as the note shows. Run it again after a reboot or an adb restart; Argent doesn't restore it. A bare RN app on a phone emulator uses `10.0.2.2` and doesn't need it; `react-native run-android` and `expo run:android` set it up themselves.
|
|
12
12
|
- **Vega (Fire TV)**: a **Debug `.vpkg`** (a Release build never attaches) and Metro reachable from the device (`vega device start-port-forwarding --port 8081 --forward false`). `debugger-component-tree`, `debugger-inspect-element`, `debugger-reload-metro` and the `react-profiler-*` / `profiler-*` tools are unavailable there; see `references/vega.md` of the `argent-tv-interact` skill.
|
|
13
13
|
- **Chromium (CDP)**: an Electron app booted with `boot-device` `electronAppPath`, or a Chromium browser exposing a CDP port (`list-devices` finds it). Pass its `chromium-cdp-<port>` id as `device_id`. Only `debugger-connect`, `debugger-status`, `debugger-evaluate`, `debugger-log-registry`, `view-network-logs` and `view-network-request-details` work there; the other debugger and profiler tools are React Native only.
|
|
14
14
|
|
|
15
15
|
## 2. Tools
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Use the `device_id` from `list-devices` and keep the same ID and Metro port across calls. On shared Metro, if `debugger-connect` cannot match an iOS simulator UDID or Android serial, it lists logical IDs. Choose the requested device's `logicalDeviceId` for subsequent debugger calls. If you later tear down this session, include that ID in `stop-all-simulator-servers`'s `devices`.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
| `debugger-
|
|
24
|
-
| `
|
|
25
|
-
| `debugger-
|
|
26
|
-
| `
|
|
27
|
-
| `debugger-
|
|
28
|
-
| `debugger-
|
|
29
|
-
| `
|
|
19
|
+
On iOS and Android, use the `list-devices` ID as `udid` for `network-capture-start` and `network-capture-stop`. If shared Metro requires a logical ID, pass it as `logicalDeviceId`, then use it as `device_id` when reading the JS capture.
|
|
20
|
+
|
|
21
|
+
| Tool | Use for |
|
|
22
|
+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
23
|
+
| `debugger-status` | Diagnosing the connection. Call it first when anything fails |
|
|
24
|
+
| `debugger-connect` | Opening the session and starting console capture |
|
|
25
|
+
| `debugger-reload-metro` | Reloading the JS bundle of an attached app |
|
|
26
|
+
| `restart-app` | Relaunching the app when it lost its Metro connection |
|
|
27
|
+
| `debugger-component-tree` | Component names and testIDs on screen. Find tap targets with `describe` |
|
|
28
|
+
| `debugger-inspect-element` | Which component is at a point and where it is defined (source file:line). Takes **logical pixels**, not normalized 0–1 |
|
|
29
|
+
| `debugger-log-registry` | Console log summary and the log file path (§4) |
|
|
30
|
+
| `debugger-evaluate` | Running a JS expression in the app runtime |
|
|
31
|
+
| `view-network-logs` → `view-network-request-details` | JS-level HTTP traffic, then the headers and body of one request. On iOS and Android, call `network-capture-start` before the action, and `network-capture-stop` when you have the requests |
|
|
30
32
|
|
|
31
33
|
A component missing from `debugger-component-tree`? `includeSkipped` only adds counts of what was pruned. Use `onScreenOnly: false` for one off screen, or `debugger-inspect-element` at its point for one on screen.
|
|
32
34
|
|
|
35
|
+
### React Native Mac apps
|
|
36
|
+
|
|
37
|
+
1. Start Metro before launching a Debug Hermes build of react-native-macos 0.76+ or React Native for Mac Catalyst. Launch Mac Catalyst through Argent so it can identify its runtime. If `boot-device` refuses a hardened react-native-macos build, have the user start it from Xcode. JavaScript tools still work. UI inspection and gestures require a build Argent can control.
|
|
38
|
+
2. Keep `macos-app-<bundle id>` as `device_id`, even on shared Metro. If a call returns `device_mismatch`, check that the Debug bundle loaded from the requested Metro port. The IDs in the error identify other targets.
|
|
39
|
+
3. Call `view-network-logs` before reproducing a JavaScript request and again after a reload. For native traffic, use `network-capture-start` and read with `native-network-logs`. The two logs can show the same `fetch()` request.
|
|
40
|
+
|
|
41
|
+
Use `describe` for tap targets. The React tools use the root with the most components, which can be in a different window. Before using a point, verify that both tools are looking at the same window. To inspect a tap point from the React tree, multiply its fractions by the width and height in `Screen: WxH`. The resulting points include the title bar. On the old architecture (Paper), native views around the React root can shift those points. Check the returned component against the intended control.
|
|
42
|
+
|
|
43
|
+
If `debugger-reload-metro` fails to reload the Mac app, use `restart-app` for an Argent-controlled build. For a build started from Xcode, restart it there.
|
|
44
|
+
|
|
33
45
|
## 3. Rules and recovery
|
|
34
46
|
|
|
35
47
|
1. **`debugger-status` first when something fails.** Only `debugger-status` and `debugger-log-registry` return `status: "not_connected"` with a `guidance`; the other tools throw. Follow the `guidance` once; do not retry in a loop.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-native-profiler
|
|
3
|
-
description: Diagnose native CPU hotspots, UI hangs, and
|
|
3
|
+
description: Diagnose native CPU hotspots, UI hangs, memory issues, and iOS app launch time. Use Instruments (xctrace) on iOS simulators, iPhones (launch time only) and Mac apps, or Perfetto on Android. Use when diagnosing native-level performance issues.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## 1. Tools and platforms
|
|
@@ -9,7 +9,7 @@ description: Diagnose native CPU hotspots, UI hangs, and memory issues. Use Inst
|
|
|
9
9
|
- `profiler-stack-query`: drill into the analyzed data (hang stacks, function callers, thread breakdown, leaks).
|
|
10
10
|
- `profiler-load`: reload an earlier session from disk.
|
|
11
11
|
|
|
12
|
-
**iOS** (Instruments via `xctrace`): simulator only; a physical iPhone
|
|
12
|
+
**iOS** (Instruments via `xctrace`): the profiling session (`native-profiler-start`) runs on a simulator only; `native-profiler-launch-analysis` (§4) also runs on a physical iPhone. Needs full Xcode (`xcrun xctrace version`). Reports CPU hotspots, UI hangs and memory leaks.
|
|
13
13
|
|
|
14
14
|
**Android** (Perfetto): emulator or physical device. Reports CPU hotspots and UI hangs (with jank reasons and the main thread's blocking function), plus an RSS-growth signal for memory pressure: treat it as a hint to confirm, not a confirmed leak. The app must be debuggable or declare `<profileable android:shell="true"/>` in its manifest, or no `perf_sample` callstacks are captured.
|
|
15
15
|
|
|
@@ -47,3 +47,15 @@ While logging is off, avoid `Leaks`, `Allocations`, and other templates that use
|
|
|
47
47
|
- **Profiler overhead:** if `JSLexer`, `JSONEmitter` or Hermes internals dominate the JS thread, that is instrumentation cost, not app work. Discount those entries.
|
|
48
48
|
- **Run-to-run variance:** treat only consistent, directional changes (across 2+ runs, or a >15% delta) as signal.
|
|
49
49
|
- **Live data:** if the app fetches live API data, different responses change the workload independently of code changes. Note when data-dependent screens vary.
|
|
50
|
+
|
|
51
|
+
## 4. App Launch (iOS)
|
|
52
|
+
|
|
53
|
+
For any iOS app (Swift, Objective-C, React Native, Flutter) when the user asks about launch or startup time.
|
|
54
|
+
|
|
55
|
+
1. Build a Release build and install it yourself with the project's own scripts or build setup (for React Native, find them as `argent-react-native-app-workflow` describes); the tool only measures an installed build. Debug-build timings are not meaningful.
|
|
56
|
+
2. Target a physical iPhone on USB. Ask the user before you use a booted simulator: its timings reflect the Mac hardware.
|
|
57
|
+
3. Run `native-profiler-launch-analysis`: `mode: "measure"` for the baseline and to verify fixes, `mode: "profile"` to find the cause of a slow launch. On an iPhone, `measure` runs on Argent's on-device runner (see `argent-ios-device-setup`); `profile` does not need it. If the runner cannot be signed, tell the user how to fix it. A profile still shows the cause, but it does not replace the five-launch baseline.
|
|
58
|
+
4. For a profile, run `profiler-stack-query` `thread_breakdown` on the main thread, then `function_callers` for the dominant function. Typical causes: static initializers, dylib loading, heavy `didFinishLaunching` work.
|
|
59
|
+
5. Rebuild and reinstall the Release build after each native or JS change, before you measure again.
|
|
60
|
+
|
|
61
|
+
`native-profiler-launch-analysis` ends at the first frame. Framework work before it (e.g. React Native runtime creation) appears in the launch profile. Work after it (e.g. a JS bundle, startup data loading, the first screen's render) is not in the result, and the first frame is often only a splash screen. For the time until the app is usable, investigate that work separately; for React Native, see Startup time in `argent-react-native-optimization`.
|
|
@@ -34,7 +34,7 @@ Before touching the app, write a compact table. Restate it in the final report.
|
|
|
34
34
|
- Stable executable evidence for each row.
|
|
35
35
|
- Required data and side effects.
|
|
36
36
|
|
|
37
|
-
Use structural checks for semantic state, snapshots for pixels, and both for mixed requirements. One behavioral scenario becomes one `qa-<area>-<behavior>` e2e test.
|
|
37
|
+
Use structural checks for semantic state, snapshots for pixels, and both for mixed requirements. One behavioral scenario becomes one `qa-<area>-<behavior>` e2e test. Do not make it depend on the state that another test leaves. A suite does not change this rule.
|
|
38
38
|
|
|
39
39
|
Do not invent a material value or weaken ambiguity. Choose the strongest UI-verifiable reading and report it. Ask when the choice changes test meaning.
|
|
40
40
|
|
|
@@ -3,7 +3,7 @@ name: argent-react-native-app-workflow
|
|
|
3
3
|
description: Step-by-step workflows for developing or debugging React Native apps on iOS simulator or Android emulator. Use when starting the app, debugging Metro, fixing builds, diagnosing runtime errors, or running tests.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
Physical iPhone (`kind: "device"`): Metro debugging and profiling tools reject it. Use a simulator.
|
|
6
|
+
Physical iPhone (`kind: "device"`): Metro debugging and profiling tools reject it. Use a simulator. Exception: measure and profile app launch on the iPhone with `native-profiler-launch-analysis` (`argent-native-profiler` §4).
|
|
7
7
|
|
|
8
8
|
react-native-macos app: start Metro (§1.2), then follow `argent-macos-app-interact` instead of `run-macos`.
|
|
9
9
|
|
|
@@ -69,7 +69,7 @@ When a build fails (e.g. xcodebuild exit code 65), try the simplest fix first: c
|
|
|
69
69
|
| **App state** | `debugger-evaluate` to run JavaScript in the app's runtime |
|
|
70
70
|
| **Native crashes / native stack** | iOS: `~/Library/Logs/DiagnosticReports/`. Android: `adb -s <serial> logcat -d`, with `-b crash` for crashes only |
|
|
71
71
|
|
|
72
|
-
If `list-devices` returns a
|
|
72
|
+
If `list-devices` returns a note about the adb server, prefix the `adb` command above as the note shows.
|
|
73
73
|
|
|
74
74
|
For connection failures, component inspection and searching the console log file, use the `argent-metro-debugger` skill.
|
|
75
75
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: argent-react-native-optimization
|
|
3
|
-
description: Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup. Delegates to argent-react-native-profiler for measurement.
|
|
3
|
+
description: Optimizes a React Native app by profiling first to find real bottlenecks, then sweeping for mechanical issues. Entry-point for all performance work. Use when the app feels slow, user asks to optimize, fix re-renders, reduce jank, or improve startup / TTI (including iOS launch time). Delegates to argent-react-native-profiler for measurement.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Rules
|
|
@@ -45,3 +45,12 @@ See [references/semantic-checklist.md](references/semantic-checklist.md) for ful
|
|
|
45
45
|
### Phase 4: Verify no regressions
|
|
46
46
|
|
|
47
47
|
Navigate every screen and UI flow within scope (the entire app if no scope was given, via `argent-device-interact`) and confirm each renders without errors. Check `debugger-log-registry` for warnings and errors (`Grep` its log file). Argent hides LogBox toasts once a `debugger-*` tool connects, so screenshots catch only full-screen red errors. Look for regressions the fixes introduced (e.g. fewer re-renders but higher CPU, or new jank on a different screen). Main agent only.
|
|
48
|
+
|
|
49
|
+
## Startup time (TTI)
|
|
50
|
+
|
|
51
|
+
TTI lasts until the first usable screen shows real content. The first native frame is often only the splash screen: bundle evaluation, startup data loading and the first screen's render usually come after it.
|
|
52
|
+
|
|
53
|
+
1. **Up to the first frame (iOS)**: measure and profile it on a Release build as §4 of `argent-native-profiler` describes. Runtime creation and JS that runs before the first frame show up in this profile.
|
|
54
|
+
2. **After the first frame**: `native-profiler-launch-analysis` does not cover it, so do not stop at the first frame. Find what the app waits for and renders before the first usable screen (what hides the splash, the startup data loading, the first screen) and measure it with the tools that fit. `react-profiler-*` cannot record startup: an app restart discards the JS runtime it attaches to.
|
|
55
|
+
|
|
56
|
+
State exactly what was measured, and what comes only from reading the code.
|