on Windows/WSL2, make sure the .wslconfig file in the Windows user directory has networkingMode=mirrored.
Mine looks like this:
[wsl2]
swap = 70G
nestedVirtualization = true
guiApplications = true
memory = 56GB
networkingMode=mirrored
[experimental]
autoMemoryReclaim=gradual
run adb server on the host (Windows).
adb server
a reboot is needed when updating some low level code that doesn't get stopped when adb shell stop runs.
m && (adb root; adb remount; adb shell stop; adb sync -z zstd; adb reboot)
otherwise, use the faster command that replaces adb reboot with adb shell start.
m && (adb root; adb remount; adb shell stop; adb sync -z zstd; adb shell start)
AOSP updates (https://grapheneos.org/build#updating-and-switching-branches-or-tags) requires redoing vendor.
rm -rf vendor/google_devices
then follow https://grapheneos.org/build#extracting-vendor-files-for-pixel-devices
on Windows/WSL2, use fastboot from the host (Windows).
set the ANDROID_PRODUCT_OUT env variable appropriately, then run the fastboot command.
$env:ANDROID_PRODUCT_OUT="\\wsl.localhost\Debian\home\user\grapheneos-VERSION\out\target\product\CODENAME"
CODENAME is the codename for the device. for example, the codename for Pixel 7a is lynx.
use fastboot. -w means it wipes before flashing.
fastboot flashall
OR
fastboot -w flashall