Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I crash/kill a running app

I would like to crash my Android app by using command-line ADB tool during my app is running, is it possible to do? and how ?

(Basically, I want to test if my app persist the necessary informations when it is crashed. So, I would like to demo this by crash my app by some command-line tool, like ADB.)

***** Update ********

In other words, how to kill my app process by using ADB tool?

like image 579
Leem.fin Avatar asked Mar 20 '12 07:03

Leem.fin


People also ask

How do I force an app to crash?

Go to the settings » App manger tap on the app which you want to crash. You will get option there of End the process. Just use that option your app will be crash...

How do I force an app to crash on Windows 10?

To quickly force quit on Windows, use the keyboard shortcut Alt + F4. Make sure the app or program window is open when you click Alt + F4. You can also force quit on Windows by using the Task Manager or Command Prompt.

What causes Apps to crash?

This usually occurs when your Wi-Fi or cellular data is slow or unstable, causing apps to malfunction. Another reason for Android apps crashing can be a lack of storage space in your device. This can occur when you overload your device's internal memory with heavy apps.


2 Answers

adb shell kill <PID>

Try the below command in abd shell.

like image 28
bas Avatar answered Oct 30 '22 09:10

bas


kill probably won't work.

adb shell am force-stop <your.app.package>
like image 140
Thejus Krishna Avatar answered Oct 30 '22 09:10

Thejus Krishna