Skip to content

Instantly share code, notes, and snippets.

@megaacheyounes
Created April 18, 2025 05:54
Show Gist options
  • Save megaacheyounes/2dc0550aae202e2e783946c12d19f800 to your computer and use it in GitHub Desktop.
Save megaacheyounes/2dc0550aae202e2e783946c12d19f800 to your computer and use it in GitHub Desktop.
@REM take screenshot on HarmonyOS Next device using HDC CLI (windows script)
@REM Requirements:
@REM 1. add hdc.exe to environment varilable (path)
@REM 2. connect watch with PC using command: hdc tconn <ip>:5555
@REM screenshots will be saved to the same folder as this script
set timestamp=%time:~0,2%_%time:~3,2%_%time:~6,2%
set spath="/data/local/tmp/harmony_screeshot_%timestamp%.jpeg"
set spath=%spath: =_%
echo %spath%
hdc shell snapshot_display -f %spath%
hdc file recv %spath%
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment