Skip to content

Latest commit

 

History

History
74 lines (30 loc) · 1 KB

ADB-CODE.md

File metadata and controls

74 lines (30 loc) · 1 KB

ADB Code

Screen status

adb shell "dumpsys power | grep mHoldingDisplaySuspendBlocker"

Current App

adb shell "dumpsys window windows | grep -E mFocusedApp | cut -d / -f 1 | cut -d ' ' -f 7"

Current App that Use Media Session, a.k.a Who is playing that sound app?

adb shell "dumpsys media_session | grep packages | cut -d = -f 3 | head -n 1"

Key events list

Sleep

adb shell input keyevent KEYCODE_SLEEP

Wake up

adb shell input keyevent KEYCODE_WAKEUP

Volume up

adb shell input keyevent KEYCODE_VOLUME_UP

Volume down

adb shell input keyevent KEYCODE_VOLUME_DOWN

Enter

adb shell input keyevent KEYCODE_ENTER

Escape

adb shell input keyevent KEYCODE_ESCAPE

Back

adb shell input keyevent KEYCODE_BACK

Home

adb shell input keyevent KEYCODE_HOME

Next

adb shell input keyevent KEYCODE_MEDIA_NEXT

Prev

adb shell input keyevent KEYCODE_MEDIA_PREV

Play/Pause

adb shell input keyevent KEYCODE_MEDIA_PLAY_PAUSE