Skip to content

Instantly share code, notes, and snippets.

@ddan9
Last active March 30, 2024 08:37
Show Gist options
  • Save ddan9/b1bc863d04a1cb6ec914a1a328a855ab to your computer and use it in GitHub Desktop.
Save ddan9/b1bc863d04a1cb6ec914a1a328a855ab to your computer and use it in GitHub Desktop.
Android tweaking through ADB. Android ADB (Android Debug Bridge) interesting commands. Through the ADB you can change hidden settings of your Android phone, you can also set hidden themes or change screen resolution

DESCRIPTION

Android ADB (Android Debug Bridge) interesting commands. Through the ADB you can change hidden settings of your Android phone, you can also set hidden themes or change screen resolution


NOTES, IMPORTANT

I am not responsible for any damage to your device

Most of these settings below are permanent and will not be reset after rebooting

Root not required (at least, for most of commands)


REFERENCES:


COMMANDS


General ADB commands:

# Check plugged-in android (ADB) devices
adb devices

# Enter android device shell
adb shell

# Show android Activity Manager commands
adb shell am

# Show android Window Manager commands
adb shell wm

# Show android cmd's
adb shell cmd

# Show android overlay cmd's
adb shell cmd overlay

# Show list of android overlay settings
adb shell cmd overlay list

# Show android settings help
adb shell settings 

# Show list of android system settings
adb shell settings list system

# Show list of android secure settings
adb shell settings list secure

# Show list of android global settings
adb shell settings list global

# Show list of props (build.prop)
adb shell getprop

Manipulating with props (build.prop):

# Show list of props
adb shell getprop

# Show types of props
adb shell getprop -T

# Show value of entered prop
adb shell getprop <prop>

# Show type of value for entered prop
adb shell getprop -T <prop>

# Enter a value for chosen prop
adb shell setprop <prop> <value>

Manipulating with settings:

# ADB-settings has a 3 default/different types of settings: system, secure, global

# Show list of settings for entered type
adb shell settings list <type>

# Show value of entered setting
adb shell settings get <type> <setting>

# Enter a value for chosen setting
adb shell settings put <type> <setting> <value>

# Example for enabling/disabling seconds in clocks:

adb shell settings put secure clock_seconds 1

adb shell settings put secure clock_seconds 0

Manipulating with themes/overlay:

# Show all possible settings for your device
adb shell cmd overlay list

# Enable entered setting
adb shell cmd overlay enable <setting>

# Disable entered setting
adb shell cmd overlay disable <setting>

# Example for enabling/disabling black-colored theme:

adb shell cmd overlay enable com.android.theme.color.black

adb shell cmd overlay disable com.android.theme.color.black

# NOTE that there is many mutually exclusive settings (like icon packs), then you need firstly disable recently chosen setting like:

adb shell cmd overlay disable com.android.theme.icon.roundedrect

adb shell cmd overlay enable com.android.theme.icon.squircle

Enable Camera2API (HAL3) with build.prop:

# NOTE that it may require root permissions

# For enabling:
adb shell setprop persist.camera.HAL3.enabled 1
adb shell setprop vendor.persist.camera.HAL3.enabled 1

# For disabling
adb shell setprop persist.camera.HAL3.enabled 0
adb shell setprop vendor.persist.camera.HAL3.enabled 0

For changing screen resolution:

# NOTE that it will 100% cause artifacts (while on boot for example)
# May increase battery life

# Check current values
adb shell wm size
adb shell wm density

# For your phone you should calculate scaling resolutions and DPI/PPI (links on top)
# For Mi A2 0.5x scaling example:
adb shell wm size 540x1080
adb shell wm density 240

# Reset values
adb shell wm size reset
adb shell wm density reset

For changing screen workspaces relative to its edges:

# If you faced with not working screen workspaces on edges
# The numbers are organised: LEFT,TOP,RIGHT,BOTTOM
# The numbers can be also negative

# Example for raise bottom workspace to 50px
adb shell wm overscan 0,0,0,50

# For reset values
adb shell wm overscan 0,0,0,0

# Or
adb shell wm overscan reset

Disable fingerprint animation:

# It will only work if your phone has an in-screen fingerprint scanner
# May make it work faster
# Values are from 0 (full) to 4 (disabled)

# For disable animation
adb shell settings put system fod_animation_type 4

# For enable animation
adb shell settings put system fod_animation_type 0

Disable fingerprint vibrations:

# NOTE that it will totally disable all system vibrations

# For disabling:
adb shell settings put system haptic_feedback_intensity 0
adb shell settings put system haptic_feedback_enabled 0

# For enabling:
adb shell settings put system haptic_feedback_intensity 1
adb shell settings put system haptic_feedback_enabled 1

Enable seconds in clocks:

# For enabling:
adb shell settings put secure clock_seconds 1

# For disabling:
adb shell settings put secure clock_seconds 0

Disable double tap to wake:

# For disabling:
adb shell settings put secure double_tap_to_wake 0

# For enabling:
adb shell settings put secure double_tap_to_wake 1

Disable wake gesture:

# For disabling:
adb shell settings put secure wake_gesture_enabled 0

# For enabling:
adb shell settings put secure wake_gesture_enabled 1

Fixing hiding notch:

# Works on OnePlus androids
# For fixing hiding notch on your phone you can try these commands

adb shell settings put secure display_cutout_hide_notch 1
adb shell settings put system op_camera_notch_ignore 1

Other interesting settings for battery life:

adb shell settings put system dim_screen 1

adb shell settings put secure doze_enabled 1

adb shell settings put global zen_mode 1

# You can also try these undocummented commands:

adb shell settings put secure hide_pocket_mode_settings 0

adb shell settings put secure hide_virtual_hd_voice_menu_settings 0

adb shell settings put system fod_vibration 0
adb shell settings put secure fod_vibration 0

adb shell settings put system double_tap_to_wake 0
adb shell settings put secure double_tap_to_wake 0
adb shell settings put system double_tap_to_wake_enabled 0
adb shell settings put secure double_tap_to_wake_enabled 0

adb shell settings put system pocket_mode 1
adb shell settings put secure pocket_mode 1
adb shell settings put system pocket_mode_enabled 1
adb shell settings put secure pocket_mode_enabled 1

My own fast-copypaste commands:

# NOTE that you shouldn't use them for yourself
# For Mi A2

adb shell setprop debug.enable-vr-mode 0
adb shell setprop debug.hwc.force_gpu_vsync 1
adb shell setprop persist.camera.HAL3.enabled 1
adb shell setprop vendor.persist.camera.HAL3.enabled 1
adb shell wm size 540x1080
adb shell wm density 240
adb shell settings put system fod_animation_type 4
adb shell settings put system haptic_feedback_intensity 0
adb shell settings put system haptic_feedback_enabled 0
adb shell settings put secure double_tap_to_wake 0
adb shell settings put secure wake_gesture_enabled 0
adb shell settings put system dim_screen 1
adb shell settings put secure doze_enabled 1
adb shell settings put global zen_mode 1
adb shell settings put secure hide_pocket_mode_settings 0
adb shell settings put secure hide_virtual_hd_voice_menu_settings 0
adb shell settings put system fod_vibration 0
adb shell settings put secure fod_vibration 0
adb shell settings put system double_tap_to_wake 0
adb shell settings put secure double_tap_to_wake 0
adb shell settings put system double_tap_to_wake_enabled 0
adb shell settings put secure double_tap_to_wake_enabled 0
adb shell settings put system pocket_mode 1
adb shell settings put secure pocket_mode 1
adb shell settings put system pocket_mode_enabled 1
adb shell settings put secure pocket_mode_enabled 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment