]> vilimpoc.org git repositories - dotfiles/blobdiff - README.md
dotfiles: add Android Studio, and a per-user Android SDK
[dotfiles] / README.md
index 55244d798cfd282fabd74bc9edb78bc3255e4e0f..e76e01720e62850f84ec00ca568e3110e06a5587 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,10 +6,11 @@ Windows development-box provisioning scripts.
 development environment: editors and shells, Python, the Visual Studio
 toolchain (including the Clang and Windows XP targeting toolsets), the Windows
 Driver Kit, Rust (rustup, with the stable MSVC toolchain for the host as the
-default), Android's `adb`, and a handful of analysis tools (Sysinternals,
-OpenCppCoverage, BinSkim, the Windows Performance Toolkit). It also sets the
-box up to be driven remotely: OpenSSH Server plus an rsync build for Windows,
-which is what makes a throwaway VM reachable from a Linux host.
+default), Android Studio and a per-user Android SDK, Android's `adb`, and a
+handful of analysis tools (Sysinternals, OpenCppCoverage, BinSkim, the Windows
+Performance Toolkit). It also sets the box up to be driven remotely: OpenSSH
+Server plus an rsync build for Windows, which is what makes a throwaway VM
+reachable from a Linux host.
 
 **Nothing happens until you have seen the plan.** It first lists every step it
 can take on this machine and lets you choose which ones to run — see
@@ -27,7 +28,7 @@ C/C++ compiler. See
 | `setup-windows.bat` | Entry point. Shows the plan and lets you choose, then runs the winget installs, launches the elevated half and prints its log, then runs the non-elevated script. |
 | `setup-windows-plan.ps1` | The plan. Run by the batch file before anything else: lists every step for this machine, grouped and numbered, and takes your choice. Run it on its own with `-WhatIf` to preview; add `-HostArch ARM64 -Elevation NOLUA` to preview another kind of box. |
 | `setup-windows-steps.ps1` | The catalog the other four read: every step's name, what it does, and where it cannot run and why. Defines functions only; it is dot-sourced, never run. |
-| `setup-windows-current.ps1` | Asked by the batch file before the Claude Code and NASM installs: is what is on the box already current? Those are the two installs that would otherwise run in full every time — see [Re-running](#re-running). |
+| `setup-windows-current.ps1` | Asked by the batch file before the Claude Code, NASM and Android Studio installs: is what is on the box already current? Those are the installs that would otherwise run in full every time — see [Re-running](#re-running). |
 | `setup-windows-no-uac.ps1` | The non-elevated, per-user half: WinMerge, BinSkim and upstream LLVM on the user `PATH` (x64 only), the global git config (identity, plus `core.sshCommand`), the native `ninja` pinned ahead of the one Visual Studio bundles, and an architecture audit of everything provisioned. Can also be run directly from an ordinary prompt; it lists its steps and asks first. |
 | `setup-windows-with-uac.ps1` | The elevated half, started via UAC by the batch file. Enables `ssh-agent`, installs the OpenSSH Client and Server capabilities and starts `sshd`, unpacks the `rsync-windows` release zip for this architecture (`rsync.exe` plus the `ssh.exe` it runs) into `C:\Tools\rsync` on the machine `PATH`, then installs Visual Studio Community with the required components, the WDK, and the Windows Performance Toolkit, and reports whether Intel VTune Profiler is present. Can also be run directly from an Administrator prompt; it lists its steps and asks first. |
 | `setup-windows-7-test-env.bat` | Prepares a **Windows 7 VM** as a test target driven from the host by `VBoxManage guestcontrol`. Copy it into the guest and run it there; it is idempotent, so re-run it after any snapshot restore. The per-user half needs no UAC (crash-dialog suppression, no screen blanking, a staging directory, the shared folder on `Z:`); the machine-wide half is skipped with a notice unless run elevated inside the guest. It then reports what the box can actually test: DWM composition, printers, audio capture devices. |
@@ -66,12 +67,12 @@ C/C++ compiler. See
       [x]  2 Brave               Brave.Brave
       ...
     E  Elevated setup (setup-windows-with-uac.ps1) - one UAC prompt, runs in its own window
-      [x] 24 OpenSshClient       OpenSSH Client capability (ssh.exe, and the libcrypto.dll rsync's ssh.exe needs)
+      [x] 25 OpenSshClient       OpenSSH Client capability (ssh.exe, and the libcrypto.dll rsync's ssh.exe needs)
       ...
-      [x] 28 VisualStudio        Visual Studio 2022 Community, C++: MSVC for x86/x64 + ARM64, SDK 26100 (several GB)
+      [x] 29 VisualStudio        Visual Studio 2022 Community, C++: MSVC for x86/x64 + ARM64, SDK 26100 (several GB)
       ...
 
-     42 of 42 steps selected.
+     44 of 44 steps selected.
 
      Enter runs the selected steps. To change them, type step numbers or ranges
      (3 5-7), step names, or a group letter (U M E C) to switch them on or off;
@@ -144,6 +145,7 @@ missing or out of date.
 | `ClaudeCode` | Anthropic's installer always downloads and reinstalls, so `setup-windows-current.ps1` asks first: is `%USERPROFILE%\.local\bin\claude.exe` the latest release — the version the installer's own endpoint names — and the build for this host? Only both skip it. |
 | `NASM` | Its per-user fallback install registers nothing, so winget cannot see it and would rerun the installer every time. `setup-windows-current.ps1` compares that `nasm.exe` with the version winget offers. A machine-wide NASM is left to winget. |
 | `Rustup` | Needs no help: rustup registers itself under the manifest's product code and rewrites its version when it updates itself, so winget sees what is really there. |
+| `AndroidStudio` | Installed only when it is missing. Studio updates itself in the app, and winget's package is marked never to upgrade it; the check keeps winget from installing over a Studio it cannot match to its package, as on a box where Studio was installed some other way. |
 | `WiX` | Skipped when 5.0.2 is already in the .NET global tool store. |
 | `OpenSshClient`, `OpenSshServer` | Installed only when the capability is not. |
 | `Rsync` | The release's `.sha256` is fetched first and compared with the hash recorded when the files were installed (`rsync-windows.sha256`). The zip is downloaded only when they differ or a file is missing. |
@@ -151,6 +153,7 @@ missing or out of date.
 | `Wdk`, `Wpt` | Skipped when the kit, or the toolkit, is already there. |
 | `BinSkim` | Asks NuGet for the newest stable version before downloading a package well over 100 MB; `nupkg-version.txt` beside the tool records what is installed. |
 | `RustToolchain` | `rustup toolchain install` updates stable when there is a newer one and otherwise reports it unchanged. |
+| `AndroidSdk` | The command-line tools are re-downloaded only when Google's package index has a newer revision than the installed one; `android sdk install` updates the platform, build-tools and platform-tools only when they are out of date. A re-run with nothing new takes seconds. |
 | `Pillow` | `pip install` leaves an installed Pillow alone. It does not upgrade it either. |
 | the rest | Configuration: `PATH` entries are added only when missing, and settings are written with the values they already have. |
 
@@ -372,6 +375,33 @@ missing or out of date.
   emulation on ARM64, which every Windows on Arm has; the audit lists it as
   expected. It stays on ARM64 for the same reason `iperf3` does: it is bound by
   the link to the device, not by the CPU.
+- **Android Studio and the Android SDK** are separate steps. Studio
+  (`Google.AndroidStudio`) is machine-wide — its installer elevates itself — and
+  is installed only when missing, since it updates itself. The SDK is per-user,
+  in Studio's default `%LOCALAPPDATA%\Android\Sdk` (or wherever `ANDROID_HOME`
+  already points): the command-line tools, platform-tools, and the newest
+  stable platform and build-tools from Google's package index, read at run
+  time. That is what Studio's first-run wizard would set up, and it is enough
+  to build: Gradle fetches whatever else a project asks for. The step sets
+  `ANDROID_HOME`, puts the command-line tools on the user `PATH`, and points
+  `JAVA_HOME` at Studio's bundled JDK for a command-line `gradlew` when there is
+  no `JAVA_HOME` already. The SDK licences are accepted on your behalf — the
+  plan says so before anything runs. Both are x64-only: Studio has no ARM64
+  build, and the SDK's Windows build tools are x86/x64. Three things about
+  the current command-line tools (23.0), found when this step was written:
+  - `sdkmanager` is deprecated. It is now a shim over the new **Android CLI**
+    (`android.exe`), which on first use installs itself into
+    `%USERPROFILE%\.android` — about 90 MB in `bin\`, and a `cli\` folder with
+    its own Java runtime. It also keeps a spool of **usage metrics** there and
+    uploads them; no opt-out was found. The step calls the CLI directly.
+  - **CLI 1.0.16406183 crashes on the way out of every `sdk` command**
+    (`0xC0000409`) on this Windows 10, after the work is done. So the step does
+    not trust its exit code: each package must be present afterwards, and a
+    crash with everything in place is printed as a note, not a failure.
+  - Windows PowerShell 5.1's progress bar made the 148 MB command-line tools
+    download take about ten minutes; with it off, the whole first install took
+    under a minute. The BinSkim download now skips the progress bar for the
+    same reason.
 - The scripts were extracted from a native Windows project, so the component
   selection is tuned for that: Spectre-mitigated runtimes, the v141/XP toolset,
   and driver-kit headers. Trim the component lists in the `.ps1` if you don't
@@ -455,6 +485,8 @@ duplicates it or that exists only as an x64 binary.**
 | VS Clang/LLVM component | `setup-windows-with-uac.ps1` | see below |
 | Windows Driver Kit | `setup-windows-with-uac.ps1` | see below |
 | BinSkim | `setup-windows-no-uac.ps1` | the NuGet package publishes `win-x64` only |
+| Android Studio (`Google.AndroidStudio`) | `setup-windows.bat` | Google publishes no Windows ARM64 build |
+| Android SDK | `setup-windows-no-uac.ps1` | its Windows build tools are x86/x64 only, as is Android Studio |
 
 x64 keeps every one of them. The decision is made in one place,
 `setup-windows-steps.ps1` (`-X64Only`, with the reason): the plan shows each as
@@ -528,8 +560,8 @@ What you end up with on ARM64:
 | **Native ARM64** | Git, Python, .NET SDK, PowerShell, VS Code, Windows Terminal, Sysinternals, Claude Code, CMake, Ninja, the VS installer, **MSVC**, MSBuild, the SDK tools (`rc`, `signtool`), rustup and **Rust** (`stable-aarch64-pc-windows-msvc`), the in-box OpenSSH client, and the Windows Performance Toolkit. |
 | **Emulated** | `iperf3` (x64; network-bound), `adb` and `fastboot` (x86 — Google ships no other Windows build; bound by the USB/TCP link to the device), and the ADK *installer* (x64; the toolkit it lays down is native). |
 | **Emulated, minor** | `py.exe` (python.org ships the launcher shim as x86; it execs the native `python.exe`) and `vswhere.exe` (Microsoft ships x86 only; runs once). |
-| **Not installed** | Brave, WinMerge, upstream LLVM, NASM, Android GPU Inspector, OpenCppCoverage, BinSkim, VS `clang-cl`, and the WDK — see the table above. |
-| **Unavailable** | VirtualBox, the Windows 7 x86 test VM, Intel VTune, and the `v141` / Windows XP targeting toolset. |
+| **Not installed** | Brave, WinMerge, upstream LLVM, NASM, Android GPU Inspector, OpenCppCoverage, BinSkim, VS `clang-cl`, the WDK, and the Android SDK — see the table above. |
+| **Unavailable** | VirtualBox, the Windows 7 x86 test VM, Intel VTune, Android Studio, and the `v141` / Windows XP targeting toolset. |
 
 ### The architecture audit