Skip to content

Instantly share code, notes, and snippets.

@ScottJWalter
Last active December 20, 2024 21:49
Show Gist options
  • Save ScottJWalter/c8368df2e0266475c19fba268e976356 to your computer and use it in GitHub Desktop.
Save ScottJWalter/c8368df2e0266475c19fba268e976356 to your computer and use it in GitHub Desktop.
Use ADB to get recent vibration requests
#!/bin/sh
# Run from an ADB debugging connection
#
# Reference:
# https://android.stackexchange.com/questions/215638/how-to-determine-which-app-is-causing-vibration
package_name=$1 # VIBRATE
for pkg in $(pm list packages | sed 's/package://')
do
echo "$pkg $(appops get $pkg $package_name)" | \
grep 'time=+[0-9]*s' | \
awk '{printf "%-12s%-20s%s\n",$3,$4,$1}'
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment