Skip to content

feat: add --install-only and --pick-device to Appium runners - #65

Merged
fadi-george merged 5 commits into
mainfrom
fadi/add-install-and-devices-flags
Oct 29, 2026
Merged

fadi-george merged 5 commits into
mainfrom
fadi/add-install-and-devices-flags

Conversation

@fadi-george

Copy link
Copy Markdown
Contributor

Description

Adds --install-only to run-local.sh and --pick-device to run-local.sh and run-all.sh, so you can install a demo app without running tests and choose which simulator or emulator to use.

Details

  • --install-only: builds, launches the device, resets, and installs the app (adb / simctl / devicectl), then exits without starting Appium or running tests. It skips the Appium/vpx checks. With --skip-build it reinstalls the existing artifact. It's not in run-all.sh because every demo has the bundle ID com.onesignal.example, so each install would overwrite the last.
  • --pick-device: shows a numbered list of iOS simulators (newest iOS first, iPhones first) or Android AVDs, with booted/running ones marked. run-local.sh asks after the platform is chosen. run-all.sh asks once up front, only for platforms that have SDKs to run (e.g. --sdks=ios only asks for a simulator), and forwards --device (plus --udid on iOS) to each run.
  • --device=NAME now overrides AVD_NAME / IOS_SIMULATOR from .env.
  • OS_VERSION is reset to the running device's OS version, so Appium's platformVersion check passes on a non-default device.
  • No breaking changes. Default runs are unchanged.

Testing: bash -n and vp check pass. I tested the picker against local simulators and AVDs, tested the iOS OS version lookup, and tested run-all.sh asking only for the relevant platforms with --sdks=ios, android, and ios,flutter. Not yet tested: a full test run on a picked device, and --install-only on a device.

🤖 Generated with Claude Code

fadi-george and others added 2 commits October 29, 2026 10:44
Builds, launches the device, resets, and installs the app, then exits
without starting Appium or running tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Prompts for an iOS simulator and/or Android AVD in run-local.sh and,
up front, in run-all.sh. Also lets --device override .env device names
and syncs OS_VERSION with the running device.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george requested a review from a team as a code owner October 29, 2026 18:23
abdulraqeeb33
abdulraqeeb33 previously approved these changes Oct 29, 2026

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice addition, both flags are genuinely useful and the implementation follows the existing runner conventions closely. Two things worth a look before merge, neither blocking.

Also three minor notes:

  • run-local/runtime.sh:409 — a failed version lookup and "version already matches" are both a silent return 0. When adb getprop times out or the simctl/python read fails, version is empty, the regex fails, and OS_VERSION quietly stays at the default. That is the exact condition the function exists to prevent, and it surfaces later as a confusing Appium platformVersion mismatch rather than "couldn't read the device OS version". Worth splitting the empty-lookup case out with a warn.
  • README.md:3 — the intro still reads "builds the app, boots a simulator/emulator, starts Appium, resets app state, and runs the E2E test suite." With --install-only that is no longer the only path. The options table covers the flag, just the lead sentence that is stale.
  • README.md:138-148 — the run-all.sh section does not mention --pick-device, though run-all.sh --help documents it.

Comment thread appium/scripts/run-local/config.sh Resolved

@sherwinski sherwinski left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments and potential issues to consider.

Comment thread appium/scripts/run-all.sh Resolved
Comment thread appium/scripts/run-local/runtime.sh Resolved
Comment thread appium/scripts/run-local/runtime.sh Resolved
Comment thread appium/scripts/run-local/runtime.sh Resolved
Comment thread appium/scripts/run-all.sh Resolved
Comment thread appium/scripts/run-local/runtime.sh Resolved
Comment thread appium/scripts/run-all.sh Resolved
- Fail the device picker on EOF instead of looping
- Make --device fully override .env on iOS (UDID, runtime)
- Forward --install-only from run-all, one SDK per platform
- Resolve the booted simulator instead of simctl's `booted` target
- Warn when the device OS version can't be read
- Extract ios_sim_version and combo_runs helpers

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george

Copy link
Copy Markdown
Contributor Author

Thanks @abdulraqeeb33. Addressed the three notes in d99ae07: empty version lookup now warns, README intro mentions --install-only, and the run-all section shows --pick-device and --install-only.

sherwinski
sherwinski previously approved these changes Oct 29, 2026

@sherwinski sherwinski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that the second fallback block in run-local/runtime.sh:82 still splices $IOS_SIMULATOR into Python source inside single quotes. The same quote-in-value failure applies as in #65 (comment). That code is outside the scope of this PR so probably worth addressing in a separate PR, or just make the update here.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george

Copy link
Copy Markdown
Contributor Author

Thanks @sherwinski, fixed the fallback lookup here in 3897959, simulator name is passed as argv now.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george merged commit 6ff5cef into main Oct 29, 2026
@fadi-george
fadi-george deleted the fadi/add-install-and-devices-flags branch October 29, 2026 22:51
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.

3 participants