4
3

More than 3 years have passed since last update.

【Android】adbのデモモードを使って、ステータスバーをキレイにする方法

Last updated at Posted at 2021-02-03

Android端末では、ステータスバーからアプリの通知などが一目で確認でき、便利ですよね。

ただ、画面のスクリーンショットを見た際に、ステータスバーがゴチャゴチャしていると、微妙な気持ちになることもあります。

例えばこんなスクリーンショットがあった場合…

↑ 「なんかいっぱい通知来ているし、充電33%だからそろそろ充電したほうが良さそう」など…

そこでこの記事では、adbのデモモードを使って、ステータスバーをキレイにする方法をご紹介したいと思います。

Demo Mode for the Android System UI

デモモードを使うと、↓のようにキレイにできます。

Before After
before.png after.png

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や関数を作るのが良いかと思います。

config.fish
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

使ってみる

実際にコマンドを実行した際の端末の様子です。
時間やバッテリーの表示が変わり、アプリの通知も消えていることがわかるかと思います。
movie.gif

これでステータスバーがキレイな状態でスクリーンショットを撮ることができますね:relaxed:

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3