As you know, you can remove local application data via adb command.
$ adb shell am clear your.package.name
The command is very useful to do Android test against release module with uiautomator, Appium an so on. But, if your application use AccountManager provided by Android platform, the command can’t remove the data stored via account manager.
What you can do is…
- Uninstall the app and install again.
- Remove account via application.
To make faster and more stable some Android test, 2 is better choice. Because installing apks take a lot of time.
So, I developed the simple application. Anyone can remove data via adb command if you install the following application into your target device.
After installing DroidTEstHelper app in your target device, you only do the following broadcast command. Then data which is stored in Account Manager is remove.
$ adb shell am broadcast -a 'DroidTestHelper' --es ACCOUNT_TYPE your.target.account.type
You should replace
your.target.account.type to your target account type.