InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search

Android development tutorials

  • Android - Show top processes using adb
  • Android studio keyboard shortcuts
  • Disable sleep during android usb debugging
  • Download apk using AirDroid
  • Enable usb debugging
  • Exerciser monkey tutorial
  • Find top processes by memory/cpu on Android using Adb
  • Find used ports by an app on Android using Adb
  • Install Android 8 on Pixel 2
  • Root Android pixel 2 using Magisk and boot image patching
  • Transfer android apk using adb
  • Using Google analytics SDK v2 for android app real time tracking
  • View Desktop Site
  • adb tutorial
 
  • Home
  • > Tutorials
  • > Android Development

Root Android pixel 2 using Magisk and boot image patching

on Aug 30, 2022

Steps to root an Android Pixel 2 phone using Magisk and boot.img patching.

Unlock bootloader

  1. Enable debug mode in Android if not done already
  2. Reboot Pixel 2 into bootloader
    adb reboot bootloader
  3. Unlock bootloader
    fastboot flashing unlock
  4. Reboot into bootloader again
    fastboot reboot
  5. Enable debug mode again

Install Magisk

  1. Download Magisk apk ( Magisk v25.2 or latest) https://github.com/topjohnwu/Magisk/releases
  2. adb install Magisk-v25.2.apk

Get and patch boot.img

  1. Download Android image for pixel2 (e.g. walleye-opd1.170816.010-factory-63083164.zip). It should be same as the installed image.
  2. Unzip the image
    unzip walleye-opd1.170816.010-factory-63083164.zip -d dir1
    cd dir1/walleye-opd1.170816.010
    unzip image-walleye-opd1.170816.010.zip -d dir2
    cd dir2
  3. Push boot.img to Android device
    adb push boot.img /sdcard/Download
  4. Run Magisk in phone and click on Magisk Install. Select “Select and patch file). Select boot.img and create a patch file.
  5. Pull patch file to Computer using
    adb pull /sdcard/Download/magisk_patched-25200_W2fd4.img

Flash Android with patched image

  1. Reboot Pixel 2 into bootloader again
    adb reboot bootloader
  2. Flash patched boot image
    fastboot flash boot magisk_patched-25200_W2fd4.img reboot
  3. Wait for reboot to finish and open Magisk
  4. Click on Superuser tab and enable Shell. Device is not rooted.

Suggested posts:

  1. Find top processes by memory/cpu on Android using Adb
  2. Android – install android 8, 9 from OTA images on pixel 2
  3. Linux – number of cpus (lscpu)
  4. Install Android 8 on Pixel 2
  5. Root Pixel 2 with Android Pie using TWRP and Magisk
  6. Python iterate dictionary
  7. How to extract number from a string – google sheets
  8. How to change default chrome search engine
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged ADB, Android Development, Pixel-2, Tutorials
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress