App not getting uninstalled through ADB

598 Views Asked by At

I am trying to uninstall an app from a device through ADB in Java code, and I am getting following issues while doing so.

Here is the APK name that contains the package:

Process p = Runtime.getRuntime().exec(new String[]{"sh","-c","./adb shell su -c 'pm uninstall "+apkName+"'"});

I got the following message in the log:

Uninstalling : com.foxit.mobile.pdf.lite
..
Running : ./adb shell su -c 'pm uninstall com.foxit.mobile.pdf.lite
'
..
Command Status : Segmentation fault 

For the one who marked it as duplicate, please look into the question clearly. This link explains how to uninstall app from shell but actually I am facing the problem while doing the same through Java code. I am creating a UI in Java for uninstalling apps in a device, and I'm stuck with the problems I have posted here.

0

There are 0 best solutions below