Using adb shell to clear application data
adb shell pm clear com.android.browser
But when executing that command from application
String deleteCmd = "pm clear com.android.browser";
Runtime runtime = Runtime.getRuntime();
try {
runtime.exec(deleteCmd);
} catch (IOException e) {
e.printStackTrace();
}
Issue:
It doesn't clear the user data neither gives any exception though I have given the following permission.
<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA"/>
Question:
How to clear the application data using adb shell?
This command worked for me:
adb shell pm clear packageName