Cheatsheet for Setting up Android Smartphones
Table of Contents
This cheatsheet reflects my development needs, which focus on AI computing tasks and running DNNs in a Linux-like environment. It may not suit you if you are primarily interested in app development and GUI debugging.
First Boot
Register
Register your new device to activate the warranty (if you are not going to root the system).
Root the System
Root access is required for advanced system control as the superuser.
This section uses a OnePlus device as an example because the brand is relatively root-friendly in China.
Requirements:
- ADB (Android Debug Bridge): platform-tools
- Android OTA payload dumper: payload-dumper-go
- System ROM: MagiskCN
- Magisk APK: GitHub Release
Unlock Bootloader
- Enter developer mode
- OEM unlock (depends on vendors)
- Connect to the host PC with USB debugging
- Enter bootloader:
adb reboot bootloader - Unlock the bootloader:
fastboot flashing unlock - On the smartphone, select “unlock the bootloader” and confirm.
Root with Magisk
- On the host PC, download the matching ROM package and extract
- Extract
init_boot.imgfrom the ROM with the payload dumper- Usage:
payload-dumper-go -p init_boot <extracted>/payload.bin
- Usage:
- Connect to the smartphone with USB debugging
- Transfer
init_boot.imgto the smartphone’s “Download” folder - Install the Magisk app on the smartphone
- In the Magisk app, select “Install” and patch
init_boot.imgto obtainmagisk_patched-xxx.img - Transfer
magisk_patched-xxx.imgback to the host PC - Enter bootloader:
adb reboot bootloader - Flash the patch:
fastboot flash init_boot magisk_patched-xxx.img- You should see “Okay” if it succeeds.
- Reboot the system:
fastboot reboot
After rebooting, open the Magisk app and check the displayed version to confirm successful root access.
System Settings
Developer Options
- Turn on developer options
- Turn on USB debugging
- Turn on wireless debugging (if you prefer)
System Update
It is recommended to turn off all settings that might influence system performance and version stability. Specifically:
- Turn off unnecessary background services
- Turn off system auto-update and auto-download
- Remove auto-installed apps
Battery Management
- Turn on “performance mode” in system-wide battery settings
- Turn on “allow background” in per-app battery settings
- Select “acquire wakelock” for Termux and similar processes
Apps
How to install:
- Install from app stores (Google Play, F-Droid, etc.)
- Install a downloaded APK (Android Application Package)
- Install from host PC by ADB (APK required)
Proxy
For a system-wide proxy, use MetaCubeX/ClashMetaForAndroid.
F-Droid
F-Droid is an installable catalog of FOSS (Free and Open Source Software) Android applications and an alternative to Google Play.
Termux
Installation through F-Droid is recommended.
Check out the Termux Setup Cheatsheet.
Microsoft Edge
Use it as an alternative to the system browser, which may have limited functionality.
I recommend Edge because it is widely available in Chinese app stores.