How to remove a stored user account in ADB?

Viewed 5024

I am looking for a solution with which it is possible to remove a stored user account (Settings -> Users & Account) via adb. Has anyone of you already done that?

1 Answers

Case for applications accounts:

You need to have root privileges to do it. The accounts are stored in the database /data/system_ce/0/accounts_ce.db which need root privileges to access it.

In case you have a rooted phone, you can simply delete the concerned entry and it'll be removed.

Case for System users

To delete a system user, you can start by listing the existing ones:

pm list users 

Each user entry is as follow : UserInfo{ID:USERNAME:INT}

To delete a user, you can use the command:

pm remove-user ID

Where ID is the ID of the user (result of the previous command)

Related