I need to get the List of apps that are enabled in the Android work Profile/Managed Profile, where My app is the Profile Owner app or alternatively how to check whether the app with given package name is Installed in work Profile/Managed Profile.
Asked
Active
Viewed 1,759 times
3
-
did you manage to get it? – Mihodi Lushan Oct 18 '20 at 05:11
-
1@MihodiLushan see my answer – Matt Oct 20 '20 at 15:36
1 Answers
0
Most adb commands provide a --user
option.
Get the user with adb shell pm list users
This should output something like:
Users:
UserInfo{0:Owner:13} running
UserInfo{10:<work profile name>:30} running
In this case the work profile user id is 10.
Now you can get the packages for that work profile with adb shell pm list packages --user 10
https://developer.android.com/work/managed-profiles
https://developer.android.com/studio/command-line/adb#shellcommands

Matt
- 2,232
- 8
- 35
- 64
-
1can it be checked programatically while running the app? I don't get it how to run shell commands programmatically in app lifecycle. – Mihodi Lushan Oct 22 '20 at 09:54