Skip to content

Instantly share code, notes, and snippets.

@m4xp1
Last active April 25, 2018 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m4xp1/f58be2cb4d6fc3fb5ff7fd1a9c6fcd02 to your computer and use it in GitHub Desktop.
Save m4xp1/f58be2cb4d6fc3fb5ff7fd1a9c6fcd02 to your computer and use it in GitHub Desktop.
Adb alias
# Add in end file ~/.bashrc
findapp() { adb shell pm list packages | grep "$1" | cat -v | sed -e 's/package://g' -e 's/\^M//g'; }
# findapp [shortName] out: com.example.package
findps() { adb shell ps | grep "$1"; }
# findps [shortName] out: process info if exist
stopapp() { adb shell am force-stop "$1"; }
# stopapp com.example.package
clearapp() { adb shell pm clear "$1"; }
# clearapp com.example.package out: Success
rmapp() { adb uninstall "$1"; }
# rmapp com.example.package out: Success
pullapp() { path=`adb shell pm path "$1" | cat -v | sed -e 's/package://g' -e 's/\^M//g'`; adb pull "$path" "$2"; if [ "$3" = "-d" ]; then apktool d "$2"; fi }
# pullapp com.example.package fileName.apk [-d] out: pull apk then decompile it in current folder if set -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment