#!/usr/bin/bash # USAGE: ./exportAPK appname # get the list of packages | filter by the appname APK_PATH=$(adb shell pm list packages -f | grep -o /data/app/.*$1.*base\.apk) # transfer the apk file to the running folder adb pull '.'$APK_PATH $1'.apk' # kill the adb server adb kill-server