0

I am trying to clear the data for a few apps on a work profile without clearing the data on the main user account for my android phone.

What I'm trying for example is :

pm clear com.Microsoft.teams

Is there a way to clear just on the work profile and not my main account?

From my research, you can't seems to specify a user for this command unlike a few other commands: pm documentation

4
  • 1
    See the latest documentation. Or pm help | grep clear which shows clear [--user USER_ID] PACKAGE Commented Jul 27, 2022 at 14:02
  • 1
    You can specify the userID for pm: --user <USER_ID> . You just need to find out which userID your work profile has.
    – Robert
    Commented Jul 27, 2022 at 14:02
  • Thanks the both of you. I was able to figure out the user id and clear it with that option.
    – Kayracer
    Commented Jul 27, 2022 at 15:55
  • @Kayracer You can write an answer yourself showing the commands you have used to get the user id and then how you deleted the data.
    – Robert
    Commented Jul 27, 2022 at 18:19

1 Answer 1

2

Thanks to the commenters, I was able to figure it out.

I used Termux with root privileges, I typed the following:

To be super user

su

Then list the users

pm list users

The number in front of UserInfo{ is what you want

ie. in my case is 12

UserInfo{0::24} running
UserInfo{12:Work profile:35} running

Last enter the clear command

pm clear --user 12 <package to clear>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .