feat: enable physical device for iOS profiling#38
Conversation
…to @stachbial/ios-profiler-for-physical-device
|
I would much prefer a single tool that lists both devices and simulators, then CLEARLY labels which device is a simulator and which is a physical device. Then the agent should have it CLEARLY explained what are the limitations & reasons for using a simulator over a device and vice versa. Unless there are arguments against this approach, my arguments are:
|
I hear you, that was my initial thought actually. Then I thought: due to the fact that most of Argent's features are heavily bound to simserver, querying the physical devices all the time would seem redundant and steering it with just a flag - harder to grasp for the agent. The standalone tool is rather easier to distinguish in such use case. |
…to @stachbial/ios-profiler-for-physical-device
…bial/ios-profiler-for-physical-device
Eventually, a unified |
…er-for-physical-device # Conflicts: # packages/skills/skills/argent-simulator-interact/SKILL.md # packages/ui/src/api/client.ts
latekvo
left a comment
There was a problem hiding this comment.
Nice. Probably also adjust the title to reflect what's being done in this PR.
@latekvo Yep It looks like You reviewed a different PR, probably a a stale diff in your cache 👀 |
…bial/ios-profiler-for-physical-device
…er-for-physical-device # Conflicts: # README.md # packages/skills/skills/argent-react-native-app-workflow/SKILL.md # packages/tool-server/src/tools/simulator/list-simulators.ts # packages/tool-server/src/utils/setup-registry.ts
Three independent bugs in the Android-path code that reviewers repro'd: 1. uiautomator entity decoder double-decoded. The decoder ran numeric references as one replace pass, then each of the five named entities as its own pass. An ampersand decoded in the first pass fed straight into the second: `&lt;` (correct XML encoding of the literal string `<`) collapsed to `<`, violating XML 1.0 §4.6. Replaced with a single regex alternation so every match is consumed once. 2. `launch-app` Android path used two different launch mechanisms — a blocking `am start -W` when the caller passed an `activity`, and a fire-and-forget `monkey … LAUNCHER 1` when they didn't. The monkey path returned as soon as the intent was injected, leaving a window where describe/tap raced a still-forking process. Unified on `am start -W` by resolving the default activity up-front via `cmd package resolve-activity --brief`. Also replaced the brittle `/Error|Exception/ && !/Status: ok/` matcher with a positive match on `Status: ok` — the old regex false-succeeded on `Status: null` (activity threw in onCreate) and would have false-failed if Android ever dropped the `Status:` banner from a release that keeps benign strings like `Activity: com.example.ErrorReportingActivity` in the output. 3. `describe` Android path shell-chained cleanup with `&&`, so a failing `uiautomator dump` (keyguard, MFA flap, secure overlay) short-circuited before `rm -f` ever ran and leaked a file per attempt under /data/local/tmp. One-char fix: trailing `; rm -f` instead of `&& rm -f`. Regression tests added for all three: `&lt;` / `&lt;` / `&amp;` stay literal, `am start` success/failure permutations, and a shell-string assertion pinning the `;` before `rm -f`.
…arch) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reconciles the physical-device iOS profiler branch with main's large tool-server restructure (tools/simulator/* split into per-tool dirs + a new multi-platform tools/devices abstraction; ios-profiler renamed to native-profiler; mcp -> argent-mcp; new argent-cli/installer/ui packages). Conflict resolution: - setup-registry.ts: took main (already registers listDevicesTool from the new tools/devices/list-devices path; the branch's only change was subsumed). - auto-screenshot.test.ts: kept main's boot-device rename (list-devices was already agreed by both sides). - 4 SKILL.md docs: took main's structure/tool names (boot-device, iOS+Android), preserved the branch's physical-device guidance where it adds value, and updated stale references (ios-profiler-start -> native-profiler-start, argent-ios-profiler -> argent-native-profiler). Ported the branch's genuine new value onto main's architecture: - utils/ios-device.ts -> utils/ios-physical-device.ts (renamed to avoid clashing with main's utils/ios-devices.ts; dropped the duplicate simulator detector in favour of main's robust execFileSync-based one). - native-profiler-start.ts: auto-detect now branches on checkIsSimulator and uses devicectl-based detectRunningAppOnDevice for physical devices. - tools/devices/list-devices.ts: added opt-in include_physical_devices flag that appends connected physical iOS devices (kind: "physical") via devicectl. - removed the orphaned tools/simulator/list-devices.ts (superseded). - completed the child_process mock in two ios-instruments tests so the new top-level promisify(execFile) import doesn't throw under partial mocks. Submodule argent-private fast-forwarded to 73c9491 (physical device research, a superset of main's 27dac19). Verified: tsc --build clean; tool-server 875/875, argent-mcp 65/65, and all other package suites green; all test files typecheck. (Pre-existing, merge- independent macOS-symlink failure in argent-installer's uninstall test remains.) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

list-simulatorstolist-deviceswhich behaves as previously with optional arg that triggersxcrun devicectl list ....run