L. D. James
L. D. James

Reputation: 1729

Is there an adb/shell command to list the items on the android's notification bar?

Can someone tell me if there is a way to get the complete list of items currently being displayed in the notification bar? I'm trying to write an interface that will trigger notifications to my PC based on the particular app giving the notification.

My only hits for something similar using the adb cli tool is Receiving push notifications using adb shell command which appears to be trying to get the notification from a particular app.

Other references that I am finding are related to actual android programming and sending your own notifications to the bar.


For the sake of formatting, I'm repeating my comment to fRoStBiT who provided the resource in his answer. The following cli provides the specific item:

$ adb shell dumpsys notification | egrep NotificationRecord | awk -F\| '{print $2}'

Upvotes: 12

Views: 25898

Answers (3)

Andrey Izman
Andrey Izman

Reputation: 1914

On Android >= 6 for get notification extras use this command

adb shell dumpsys notification --noredact

the full notifications text you can see at the extras section:


      extras={
          android.title=String (Bring The Rain)
          android.reduced.images=Boolean (true)
          android.subText=null
          android.template=String (android.app.Notification$MediaStyle)
          toSingleLine=Boolean (false)
          android.text=String (Upon A Burning Body)
          android.appInfo=ApplicationInfo (ApplicationInfo{c8165e6 org.telegram.messenger})
          android.showWhen=Boolean (false)
          android.largeIcon=Icon (Icon(typ=BITMAP size=100x100))
          android.mediaSession=Token (android.media.session.MediaSession$Token@608a746)
          gameDndOn=Boolean (false)
          android.compactActions=int[] (3)
            [0] 0
            [1] 1
            [2] 2
      }

Upvotes: 10

Andres
Andres

Reputation: 91

adb shell dumpsys notification | grep ticker | cut -d= -f2

shows me a little description of the texts of the screen. tickerText appears to be the name of the property which contains the text of the notifications

Upvotes: 9

Vladimir Petrakovich
Vladimir Petrakovich

Reputation: 4286

You can use

adb shell dumpsys notification

It shows detailed information about currently displayed notifications.

Upvotes: 25

Related Questions