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}'
On Android 5.0, go to Settings -> Storage -> menu -> USB computer connection and make sure 'Media device (MTP)' is disabled. When it's disabled 'adb devices' lists the device, when enabled not.
Open cmd type adb shell then press enter. Type ls to view files list. At the DOS prompt, adb shell ls -R > junk lists all files and puts results into file junk which you can then edit via Notepad or whatever and see more than you'd want to, but your files, too!
You can use
adb shell dumpsys notification
It shows detailed information about currently displayed notifications.
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
}
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With