feat(app-expo): Windows-friendly Android dev scripts + environment doctor - #691
Open
k6G52m4Dz75W wants to merge 3 commits into
Open
feat(app-expo): Windows-friendly Android dev scripts + environment doctor#691k6G52m4Dz75W wants to merge 3 commits into
k6G52m4Dz75W wants to merge 3 commits into
Conversation
The npm scripts used Unix-style APP_VARIANT=development cmd env assignment,
which fails on Windows cmd/PowerShell ('APP_VARIANT' is not recognized). Prefix
them with cross-env (added as devDependency) so pnpm start / pnpm android
work cross-platform.
… doctor - npm scripts used Unix-style APP_VARIANT=... which fails on Windows cmd/PowerShell. Prefix with cross-env (new devDependency) so pnpm expo:start / expo:android work cross-platform. - Add scripts/check-android-env.ps1: a doctor that verifies Node/pnpm, JDK 17+, Android SDK (platform-tools, platforms, build-tools, licenses) and an emulator/device, printing concrete fix steps and exiting non-zero on failure. - Wire pnpm expo:doctor:android (app-expo doctor:android + root alias). - Document the Windows Android setup in README.md / README_CN.md.
…'t swallow it Under Continue=SilentlyContinue, PowerShell drops the NativeCommandError records produced by 2>&1, so java -version came back empty and the doctor reported "Could not read the JDK version". Merge java's stderr at the OS level with cmd /c ... 2>&1 instead.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On Windows, every
expo:*npm script failed with'APP_VARIANT' 不是内部或外部命令because the scripts used Unix-styleAPP_VARIANT=development pnpm ...env assignment, which cmd/PowerShell do notsupport. This PR makes the mobile dev scripts work cross-platform and adds a
doctor script so Windows contributors can verify their Android toolchain in one
command.
Changes
APP_VARIANT=...scripts (start,start:clear,android:dev,ios:*,eas:build:*) withcross-env(added as adevDependency) so they run in Windows PowerShell/cmd and keep working on
macOS/Linux/CI.
scripts/check-android-env.ps1: a PowerShell doctor that checksNode/pnpm, JDK 17+, the Android SDK (platform-tools, platforms, build-tools,
accepted licenses) and an emulator AVD / connected device. Prints
[ OK ]/[FAIL]per item with concrete fix steps and exits non-zero on failure.pnpm expo:doctor:android: new npm script + root alias to run the check.README.md/README_CN.md(JDK, Android Studio, SDK components, AVD, envvars, then
pnpm expo:doctor:android→pnpm expo:start+pnpm expo:android).Example output