Skip to content

Let the screenshot commands target a named simulator and emulator - #98

Open
simonhamp wants to merge 1 commit into
mainfrom
feat/screenshot-device-options
Open

simonhamp wants to merge 1 commit into
mainfrom
feat/screenshot-device-options

Conversation

@simonhamp

Copy link
Copy Markdown
Member

screenshots:take and screenshots:record use the first booted iOS simulator and the first Android emulator, and only warn when there's more than one. With several sessions working on the app at once, each with its own simulator and emulator, that's often another session's device. Two sessions today wrote their own shoot.sh to get around it.

Both commands now take --ios=<udid> and --android=<serial>. A named device is used instead of the auto-pick. If it isn't booted or connected, the command stops with an error before it changes any appearance or creates the screenshots folder. Without the options nothing changes, apart from the "more than one is running" warnings now saying which option picks another device.

The ui-screenshots skill now says to pass your own UDID and serial whenever other simulators or emulators are running.

The check lives in DrivesSimulators, so both commands get it. It uses $this->fail(), which is new for these commands (the others print an error and return null). It reads more simply here because the device lookup happens two calls down from handle().

Tests fake Process like the existing ones and check that every simctl and adb call goes to the named device, for both commands, and that a missing device fails after only listing devices.

Screenshots

  • No visible change

🤖 Generated with Claude Code

screenshots:take and screenshots:record pick the first booted simulator
and the first emulator. When several sessions each run their own, that
can be another session's device, so they ended up writing shell scripts
to do the capture by hand.

Both commands now take --ios=<udid> and --android=<serial>. A named
device is used in place of the auto-pick, and the command stops with an
error before touching anything if it isn't booted or connected. Left
out, nothing changes, except the "more than one" warnings now mention
the option. The ui-screenshots skill says to pass your own devices when
others are running.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant