Obtain the official image from Google’s repository for GSI releases (or trusted sources like LineageOS GSI builds). The official Android 12 GSI filename will exactly match: system-arm64-ab.img.xz.
To avoid a bootloop caused by residual data:
fastboot -w
This wipes userdata and metadata.
Use a tool like 7-Zip (Windows), unxz (Linux/macOS), or Keka (Mac) to extract:
unxz system-arm64-ab.img.xz
You will now have system-arm64-ab.img (roughly 1–2 GB). system-arm64-ab.img.xz android 12
There are two main branches of GSIs:
The system-arm64-ab.img.xz file often comes from these community sources, especially for Android 12, which is less common in official Google GSIs after Android 13's release. Obtain the official image from Google’s repository for
Your device vendor must support Treble. For Android 12 GSIs, the required vendor level is at least VNDK 30 (Android 10) or VNDK 31 (Android 11). Android 12 GSI on an Android 9 vendor (VNDK 28) will likely bootloop. Check with getprop ro.treble.enabled (should return true).
Decompress the .xz file. The resulting system.img typically ranges from 1.5 GB to 3 GB. Your device's system partition must be larger than that. Check with fastboot getvar system-size (approx). If the image is too large, you may need to repartition (risky) or resize the system partition via custom recovery. This wipes userdata and metadata