Created
January 2, 2026 17:38
-
-
Save sidferreira/2b9b2cef2e6d17e13d8678acf0c1ca82 to your computer and use it in GitHub Desktop.
ADB ScreenShot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Generate filename with timestamp | |
| filename="Android Screenshot $(date +"%Y-%m-%d at %I.%M.%S %p").png" | |
| desktop_path="$HOME/Desktop/$filename" | |
| # Take screenshot using adb and save to Desktop | |
| adb exec-out screencap -p > "$desktop_path" | |
| # Check if the screenshot was successful | |
| if [ $? -eq 0 ]; then | |
| echo "Screenshot saved to: $desktop_path" | |
| else | |
| echo "Failed to take screenshot. Make sure your Android device is connected." | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment