Root a Google Pixel 3a – Full Guide

1️⃣ Preparations

**ADB & Fastboot** (example for Windows): https://dl.google.com/android/repository/platform-tools-latest-windows.zip

2️⃣ Enable Developer Options & OEM Unlock

  1. Open SettingsAbout phone → tap Build‑number 7× → “You’re a developer!”.
  2. Back to Settings → SystemAdvancedDeveloper options.
  3. Turn on OEM Unlocking (and USB debugging if you like).

3️⃣ Unlock the Bootloader (erases all data)

# Connect phone
adb devices

# Reboot into bootloader
adb reboot bootloader

# Verify device
fastboot devices

# Unlock (factory reset will follow)
fastboot flashing unlock
# On phone: use volume keys to choose “Yes”

After unlock your phone will reboot and perform a factory reset.

4️⃣ Flash a Custom Recovery (TWRP)

  1. Download TWRP image for Pixel 3a: twrp‑3.3.1‑20240220‑google‑3a.img
  2. Place it next to your fastboot binary.
  3. Reboot into bootloader: adb reboot bootloader
  4. Flash recovery: fastboot flash recovery twrp‑3.3.1‑20240220‑google‑3a.img
  5. Boot straight into TWRP: fastboot boot twrp‑3.3.1‑20240220‑google‑3a.img

5️⃣ Install Magisk (Root)

  1. Download latest Magisk ZIP from GitHub (e.g. Magisk-v23.3‑20240221‑20240221‑v1.zip).
  2. In TWRP tap Install, choose the ZIP, swipe to flash, confirm.
  3. After flashing, Reboot System.
  4. Install the Magisk Manager app (same release page) to verify root.

6️⃣ (Optional) Put OpenClaw in /system

Root isn’t required for OpenClaw, but you can place it in /system for system‑wide availability.

# In TWRP Terminal or via adb shell
fastboot reboot bootloader
adb shell
# Mount /system read‑write
mount /system
mount -o remount,rw /system
# Copy binary (assume it's on /sdcard/tmp/)
cp /sdcard/tmp/openclaw /system/bin/
chmod 755 /system/bin/openclaw
# Reboot
reboot

7️⃣ Verify Everything

  1. Open Termux (or any terminal). Check root status:
    su -c "id"
  2. Run OpenClaw (if installed in /system):
    openclaw --help
  3. Or, if using Termux build:
    ~/openclaw/build/bin/openclaw --help

8️⃣ Safety & Reverting

If you ever need to return to stock: