Skip to content

Instantly share code, notes, and snippets.

Created May 18, 2022 00:38
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
General steps to install/flash a new Android ROM.

Flash Android on Linux

General steps to install/flash a new Android ROM. v0.0

Pre requisites

Android 12:: before enter recovery, remove all lockscreen passwords/PINs in Android.

which adb
# /usr/bin/adb

which lsusb
# /usr/bin/lsusb

If not found

#Debian based
apt install android-tools-adb android-tools-fastboot usbutils

echo "dev-util/android-tools python" >> /etc/portage/package.use/dev-util
echo "sys-apps/usbutils python" >> /etc/portage/package.use/sys-apps
emerge -av dev-util/android-tools sys-apps/usbutils

Give user correct permisisons

gpasswd -a <username> plugdev


Go to Settings -> About -> Version Number a million times to unlock dev options. Then go to Settings -> System -> Dev options -> USB Debug.

Connect to phone

This procedure must be done for each phone state (recovery, adb sideload, file transfer...).

# ...
# Bus 001 Device 022: ID abcd:1234 Google Inc. Nexus/Pixel Device (charging + debug)
# ...

Add a new udev rule

nano /etc/udev/rules.d/51-android.rules

UBSYSTEM=="usb", ATTR{idVendor}=="abcd", ATTR{idProduct}=="1234", MODE="0666", GROUP="plugdev"

Restart adb

adb kill-server
adb devices
#1077exxx         device

Install ROM (Clean Install)

adb reboot recovery

In OrangeFox

  • Wipe data, cache, ART/Dalvik cache (you'll lose all of you data!)
  • Format Data


  • ADB/Sideload -> Sideload

    adb devices #1077exxx device #if none, repeat Connect to phone" to add new id (yes, a new one)

    adb sideload adb sideload #adb sideload gapps/magisk/


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment