Skip to content

Commit

Permalink
Merge pull request #228 from luispinho/feature/android-lock-unlock
Browse files Browse the repository at this point in the history
Merge feature/android lock unlock
  • Loading branch information
IGPenguin authored Oct 17, 2024
2 parents 985a97a + 8872fd2 commit cd15648
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- [🎹 acontrol](#section-id-100)
- [📷 acamera](#section-id-104)
- [⚡️ awireless](#section-id-107)
- [👋 apowerbutton](#section-id-108)
- [Manage packages](#section-id-111)
- [🚀 alaunch](#section-id-113)
- [🕵️ aappinfo](#section-id-118)
Expand Down Expand Up @@ -206,6 +207,12 @@ _Note: This tool targets macOS for compatibility, but most interactions should w
* Enable or disable wireless ADB connection
* Use ADB and toolkit without having USB cable attached

<div id='section-id-108'/>

### 👋 apowerbutton
* Lock/Unlock the device (send Power button key event)
* Useful to unlock the device after the screen is locked automatically

<div id='section-id-111'/>

## Manage packages
Expand Down
9 changes: 9 additions & 0 deletions android/apowerbutton
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
source "$(dirname "$0")"/../common_tools
android_choose_device

# Reference for key events - https://gist.github.com/arjunv/2bbcca9a1a1c127749f8dcb6d36fb0bc

echo "👋 Clicking power button…"
# Send POWER screen key event (key 26)
adb -s "$SELECTED_DEVICE" shell input keyevent POWER

0 comments on commit cd15648

Please sign in to comment.