Skip to content

Instantly share code, notes, and snippets.

@AzimsTech
Last active February 27, 2026 15:57
Show Gist options
  • Select an option

  • Save AzimsTech/cab4314e575f155818fca7ba2db9e755 to your computer and use it in GitHub Desktop.

Select an option

Save AzimsTech/cab4314e575f155818fca7ba2db9e755 to your computer and use it in GitHub Desktop.
ADB commands

Useful ADB Commands (for Windows)

Get device ip address

adb shell su -c 'ip route | awk '"'"'{print $9}'"'"''

List user app's package name

adb shell su -c '"pm list packages -f" | grep "/data/app/" | sed -e "s/.*=//"'

Set App Standby Buckets

See: Android.com - App Standby Buckets

adb shell su -c '"pm list packages -f" | grep "/data/app/" | sed -e "s/.*=//" | while read comm; do echo "set $comm to RARE"; am set-standby-bucket $comm rare; sleep 3; done;'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment