Tweaking your Android device using adb shell
allows you to make various system changes without root access. Below are some common tweaks and commands you can use to modify your device’s behavior.
Prerequisites
- ADB Installed: Make sure you have ADB installed on your computer.
- USB Debugging Enabled: On your device, go to
Settings > Developer Options
and enableUSB Debugging
.
Basic ADB Shell Commands
Connect Your Device:
Connect your Android device to your PC via USB.
Open a terminal or command prompt on your PC.
Enter the following command to start the ADB shell:
adb shell
Navigating the File System:
To list files and directories:
ls
To change directories:
cd /path/to/directory
To view current directory:
pwd
Basic File Operations:
Copy files from your PC to the device:
adb push <local-file-path> <remote-path>
Copy files from your device to the PC:
adb pull <remote-file-path> <local-path>
Tweaks
Change Screen Density (DPI):
Check current DPI:
adb shell wm density
Set new DPI:
adb shell wm density <value> && adb reboot
Adjust Animation Scales:
Reduce lag by changing animation scales:
adb shell settings put global window_animation_scale 0.5 adb shell settings put global transition_animation_scale 0.5 adb shell settings put global animator_duration_scale 0.5
Disable animations completely:
adb shell settings put global window_animation_scale 0 adb shell settings put global transition_animation_scale 0 adb shell settings put global animator_duration_scale 0
Grant Permissions to Apps:
Grant a specific permission to an app:
adb shell pm grant <package_name> <permission>
Example:
adb shell pm grant com.example.app android.permission.WRITE_SECURE_SETTINGS
Modify System Properties:
Change a system property:
adb shell setprop <key> <value>
Example:
adb shell setprop persist.sys.theme dark
Manage Packages:
List all installed packages:
adb shell pm list packages
Uninstall a package:
adb shell pm uninstall -k --user 0 <package_name>
Toggle Airplane Mode:
Enable Airplane Mode:
adb shell settings put global airplane_mode_on 1 adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state true
Disable Airplane Mode:
adb shell settings put global airplane_mode_on 0 adb shell am broadcast -a android.intent.action.AIRPLANE_MODE --ez state false
Control Screen Timeout:
Set screen timeout (in milliseconds):
adb shell settings put system screen_off_timeout <milliseconds>
Example:
adb shell settings put system screen_off_timeout 60000
Change Keyboard Layout:
Set default input method:
adb shell settings put secure default_input_method <input_method_id>
List available input methods:
adb shell ime list -a
Adjust Doze Mode:
Check current Doze mode state:
adb shell dumpsys deviceidle
Enable aggressive Doze mode:
adb shell dumpsys deviceidle enable adb shell dumpsys deviceidle force-idle
Disable Doze mode:
adb shell dumpsys deviceidle disable
Using Shizuku for More Advanced Tweaks
Shizuku allows apps to use system APIs directly with elevated privileges without requiring root. You can grant permissions and perform certain actions that usually require root by using Shizuku in conjunction with ADB.
Install Shizuku:
- Download and install the Shizuku APK from the Shizuku GitHub repository.
Start Shizuku via ADB:
Connect your device to your PC via USB.
Run the following command:
adb shell sh /sdcard/Android/data/moe.shizuku.privileged.api/files/start.sh
Grant Permissions via Shizuku:
- Open Shizuku and follow the instructions to configure it.
- Use the Shizuku interface to grant permissions and manage your apps.
By following these steps and using these commands, you can tweak and customize your Android device using adb shell
, even without root access.