App Environment Manager
When to use
Before scaffolding or building, and whenever a build fails on a missing tool.
Inputs
- Target id, host OS.
Procedure
appfactory action=doctor target=<id>. It never installs anything.- Host check:
windowsMSI needs Windows;iosandmacosneed macOS + Xcode. Otherwise propose a CI runner (GitHub Actionswindows-latest,macos-latest,ubuntu-latest). - Missing tools:
ask_user("Install the Android toolchain now" recommended / "Use a CI runner" / "Stop"). Client wording never names Rust, Gradle, Android SDK, Tauri or Capacitor. - After consent,
execthe official commands (long onesbackground=true, polled):- Rust (all desktop):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; Windows:winget install Rustlang.Rustup. - Targets:
rustup target add x86_64-pc-windows-msvc,aarch64-apple-darwin x86_64-apple-darwin. - Windows:
winget install Microsoft.VisualStudio.2022.BuildTools --override "--wait --passive --add Microsoft.VisualStudio.Workload.VCTools --includeRecommended",winget install Microsoft.EdgeWebView2Runtime. - Ubuntu/Debian:
sudo apt-get install -y libwebkit2gtk-4.1-dev build-essential curl wget file libxdo-dev libssl-dev libayatana-appindicator3-dev librsvg2-dev rpm. - Fedora/CentOS Stream/RHEL:
sudo dnf install -y webkit2gtk4.1-devel openssl-devel curl wget file libappindicator-gtk3-devel librsvg2-devel rpm-buildandsudo dnf group install -y "c-development"(or"Development Tools"). - macOS:
xcode-select --install(full Xcode from the App Store for iOS). - JDK 21 (Android): Temurin,
winget install EclipseAdoptium.Temurin.21.JDK,brew install --cask temurin@21, orsudo apt-get install -y temurin-21-jdkafter adding the Adoptium repo. - Android SDK: command line tools from developer.android.com, then
sdkmanager "platform-tools" "platforms;android-35" "build-tools;35.0.0"andsdkmanager --licenses; setANDROID_HOMEandJAVA_HOME. - iOS: Xcode,
sudo gem install cocoapodsorbrew install cocoapods.
- Rust (all desktop):
- Re-run doctor until green.
Verification
rustc --version, cargo --version, java -version (21), sdkmanager --list_installed, adb version, node --version.
Failure modes and fixes
sudoneeds a password: give the user the exact command to run inopen_terminal.- PATH not updated after install: new shell, or
source "$HOME/.cargo/env".
Deliverable
Green doctor or agreed CI path; report step tools.
