Android端末では、ステータスバーからアプリの通知などが一目で確認でき、便利ですよね。
ただ、画面のスクリーンショットを見た際に、ステータスバーがゴチャゴチャしていると、微妙な気持ちになることもあります。
例えばこんなスクリーンショットがあった場合…
↑ 「なんかいっぱい通知来ているし、充電33%だからそろそろ充電したほうが良さそう」など…
そこでこの記事では、adbのデモモードを使って、ステータスバーをキレイにする方法をご紹介したいと思います。
Demo Mode for the Android System UI
デモモードを使うと、↓のようにキレイにできます。
Before | After |
---|---|
adbコマンド
まず、下記のコマンドでデモモードを有効にします。
$ adb shell settings put global sysui_demo_allowed 1
有効になった後、 com.android.systemui.demo
のBroadcastで適宜オプションを指定し、ステータスバーの状態を変更させることが可能です。
// 時間表示を変更。この例では00:00で表示。
$ adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 0000
// ネットワーク表示を変更。この例ではWi-Fiを表示。
$ adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4
// バッテリー表示を変更。この例では100%で表示。
$ adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false
// アプリの通知を変更。この例ではアプリの通知を非表示に設定。
$ adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
デモモードを終了するには下記コマンドを実行すると解除できます。
$ adb shell am broadcast -a com.android.systemui.demo -e command exit
実際に使う場合には、シェルにaliasや関数を作るのが良いかと思います。
function enterDemoMode
adb shell settings put global sysui_demo_allowed 1
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 0000
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4
adb shell am broadcast -a com.android.systemui.demo -e command battery -e level 100 -e plugged false
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
end
function exitDemoMode
adb shell am broadcast -a com.android.systemui.demo -e command exit
end
使ってみる
実際にコマンドを実行した際の端末の様子です。
時間やバッテリーの表示が変わり、アプリの通知も消えていることがわかるかと思います。
これでステータスバーがキレイな状態でスクリーンショットを撮ることができますね