How can I programmatically remove/clear a linked account from an Android device within Android Settings > Accounts? Is this possible with ADB or Appium, or by some other programmatic method?
Android devices typically keep linked accounts for Google or Facebook on a device settings level, not within a single app's cache. I would like to remove these accounts (especially Facebook, which appears to only have one account per device).
The context for the question is in automated testing.
- Removing accounts manually/by hand is not an option.
- I'd prefer not to do it via Appium UI automation; even if Appium could solve this problem on one device, different android devices/OS versions have different settings UI, thus UI automation is not a scalable solution.
- The best, easiest, and most scalable solution would allow me to do an ADB command which could remove the linked account.
Edit:
Here is an unanswered question on Appium forums asking a similar question: https://discuss.appium.io/t/android-how-to-remove-google-accounts-linked-a-device-on-setting-activity/6920