Skip to content

fix(cli): resolve Windows Appium and Android SDK binary paths - #1405

Merged
Simon Ingeson (smonn) merged 6 commits into
mainfrom
wiz-11276-resolveappiumbin-returns-a-non-executable-path-on-windows
Jul 30, 2026
Merged

fix(cli): resolve Windows Appium and Android SDK binary paths#1405
Simon Ingeson (smonn) merged 6 commits into
mainfrom
wiz-11276-resolveappiumbin-returns-a-non-executable-path-on-windows

Conversation

@smonn

@smonn Simon Ingeson (smonn) commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Fixes WIZ-11276

Overview of Changes

node_modules/.bin/appium is the extension-less POSIX script, which Windows cannot execute, so Android flows and the appium / uiautomator2-driver doctor checks failed there. The CLI now resolves the appium.cmd wrapper npm writes beside it, paired with the shell: true Node requires for a batch file after CVE-2024-27980. The same treatment reaches sdkmanager.bat and avdmanager.bat in cmdline-tools.

Every Android binary now resolves through one pure module, src/core/androidBins.ts, so the next one cannot drift. Two structural commits are split out: the move into core/, and the extraction of the defaultAdb executor that emulatorSetup and createAndroidEmulator each carried a copy of.

WIZ-11274 has since landed, and main is merged in. It touched the same security-contract comment in src/shell/spawn.ts, so that roster now lists both sets of call sites. It also added a platform field to the doctor's CheckDeps for its npm check, which git collapsed into the one this branch added for the Android checks.

Testing

Not verified on a real Windows host. Every win32 branch takes platform as an argument, so the tests assert it on any host.

bun run typecheck
bun run lint
bun run format:check
bun run knip
bun run test
bun run build

Checklist

  • Changes follow the code style of this project
  • Self-review completed
  • Tests added/updated (or not applicable)
  • No breaking changes (or described below)

node_modules/.bin/appium is the extension-less POSIX script; CreateProcess
cannot run it. Prefer the appium.cmd wrapper npm writes beside it, and pair
it with the shell:true Node requires for a batch file after CVE-2024-27980.

createAndroidEmulator has the same defect for a different reason: libuv
appends .exe only during a PATH search, never to an explicit path, so
$ANDROID_HOME/emulator/emulator and .../platform-tools/adb both miss.

Fixes WIZ-11276
emulatorBin and adbBin are pure path builders, and three more call sites
need them: emulatorSetup, the doctor SDK checks, and the AVD installer.
cmdline-tools ships sdkmanager and avdmanager as POSIX scripts plus .bat
wrappers, and only the wrapper runs on Windows; defaultSpawn already adds
the shell:true a batch file needs. The doctor SDK checks and emulatorSetup
built adb and emulator paths of their own, so both missed the .exe suffix
the previous commit added.

The doctor checks take platform as a dep so the win32 branch is assertable
on any host.
emulatorSetup and createAndroidEmulator each carried a copy of defaultAdb.
The comment in emulatorSetup asked for this once a third call site appeared.
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The change adds platform-aware Android binary helpers, selecting .exe executables and .bat command-line tool wrappers on Windows. Doctor and Android installation flows now propagate process.platform. Appium resolution selects appium.cmd, Windows spawning enables shell execution for that shim, and ADB execution moves to a dedicated module. Tests cover platform-specific paths and spawn options.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • qawolf/cli#1403: Threads platform information through doctor dependencies using a similar handleDoctorrunChecks flow.
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits and clearly summarizes the Windows Appium and Android SDK path fixes.
Description check ✅ Passed The description matches the template with overview, testing commands, and a completed checklist.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wiz-11276-resolveappiumbin-returns-a-non-executable-path-on-windows

Comment @coderabbitai help to get the list of available commands.

…umbin-returns-a-non-executable-path-on-windows

# Conflicts:
#	src/shell/spawn.ts
@smonn
Simon Ingeson (smonn) merged commit 9ba1a27 into main Jul 30, 2026
6 checks passed
@smonn
Simon Ingeson (smonn) deleted the wiz-11276-resolveappiumbin-returns-a-non-executable-path-on-windows branch July 30, 2026 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants