Skip to content

Instantly share code, notes, and snippets.

@Zhuinden
Forked from mlykotom/appkill.sh
Created April 24, 2020 22:14
Show Gist options
  • Save Zhuinden/99db86083c2626ce7c8a35c99623eb3f to your computer and use it in GitHub Desktop.
Save Zhuinden/99db86083c2626ce7c8a35c99623eb3f to your computer and use it in GitHub Desktop.
Script for killing Android app (as system would)
#!/bin/bash
# Provide package of your application (com.example.myapp)
PACKAGE=$1
# First, put your app to background and then run this script
echo "Killing $PACKAGE"
adb shell ps | grep $PACKAGE | awk '{print $2}' | xargs adb shell run-as $PACKAGE kill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment