Skip to content

Instantly share code, notes, and snippets.

@fuka
Created November 22, 2021 10:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fuka/01e9171fbaa9e54a589ae8a34020d28c to your computer and use it in GitHub Desktop.
Save fuka/01e9171fbaa9e54a589ae8a34020d28c to your computer and use it in GitHub Desktop.
adbコマンドでスクリーンショットを撮るバッチファイル
@echo off
rem ファイル名に日時を入れる
set dt=%date%
set tm=%time: =0%
set d=%dt:~0,4%%dt:~5,2%%dt:~8,2%
set t=%tm:~0,2%%tm:~3,2%%tm:~6,2%
set file_name=screenshot_%d%_%t%.png
rem デモモードを有効にする
adb shell settings put global sysui_demo_allowed 1
rem 時刻を12:00にする
rem "> nul" で標準出力へのメッセージ表示を抑止(以下も同様)
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200 > nul
rem ネットワークをWi-Fiにする
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 > nul
rem バッテリー残量を100%にする
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false > nul
rem アプリの通知を非表示にする
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false > nul
rem スクリーンショットを撮る
adb exec-out screencap -p > "%file_name%"
rem デモモードを解除する
adb shell am broadcast -a com.android.systemui.demo -e command exit > nul
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment