- Samsung offers the Secure Folder feature that works like a vault where you can securely keep sensitive data.
- The Secure Folder enables “User 150” which blocks apps from unauthorized sources and commands over a USB connection.
- When Secure Folder or User 150 is enabled, you’ll get the command execution error.
- To fix it, navigate to Settings > Security and Privacy > More Security Settings > Secure Folder > More Settings and tap Uninstall.
The Security Folder on Samsung phones acts as a virtual vault that shields personal information from unauthorized access. This folder stores your financial records, private media files, or important documents files securely. However, if you enable Secure Folder or Auto Blocker on your Samsung device, you may encounter the “exception occurred while executing command” or User 150 error while executing ADB Shell commands. This tutorial will provide workarounds to fix this error on Samsung Galaxy devices.
What is User 150 on Samsung Devices?
One day, I needed to get a list of the system apps installed on my Galaxy S24 but when I executed the command, I got the following error in PowerShell.
e3q:/ $ pm list packages -s Exception occurred while executing 'list': java.lang.SecurityException: Shell does not have permission to access user 150 at com.android.server.am.UserController.handleIncomingUser(UserController.java:2892) at android.app.ActivityManager.handleIncomingUser(ActivityManager.java:5134) at android.os.Binder.execTransactInternal(Binder.java:1380) at android.os.Binder.execTransact(Binder.java:1311)
If the Samsung Secure Folder is enabled, you’ll get the following error when running the ADB uninstall command.
Exception occurred while executing 'uninstall': java.lang.SecurityException: Shell does not have permission to access user 150
The error says that the ADB “Shell does not have permission to access user 150”. ‘User 150’ on Samsung Galaxy devices refers to a specific user profile activated when the Secure Folder is enabled. Since ADB Shell commands can perform advanced tasks like pushing and pulling data, any attempt to execute such commands is blocked by the device. Moreover, when the ‘user 150’ is active, ADB treats your Samsung device to have multiple user profiles and fails to perform tasks because the user ID is not mentioned in the command.
Suppose, you have multiple Android devices connected to your computer. If you issue a plain ADB command without mentioning the device ID, the command won’t work because ADB requires directions as to which device you want to send the command to. Below is a screenshot of the device IDs listed under ADB devices.
In such a case, you must specify ID of the device 1 or device 2 in your command as shown below.
adb -s RZCX11NEPKK shell
If you are trying to execute ADB commands wirelessly, you have to specify the IP address and port as the device ID of the target Android device.
adb -s 192.168.1.6:5555 shell
The simplest way to save yourself from mentioning the device ID in ADB commands is to disconnect one of the devices.
In the same way, if only one Android device is connected to ADB but there are multiple user profiles on the device, you must specify the user ID in your ADB command to make it work. By default, the user ID of the device owner on Android devices is ‘user 0’. If you have created another user, the ID for the second user will use ‘user 1’. Similarly, the user ID of the Samsung Secure Folder is ‘user 150’.
Fixing Command Execution Error on Samsung
Now that you know how to deal with ADB commands when multiple devices are connected to your computer or multiple user profiles are present on your Android device, you can try the workarounds provided below.
Uninstall the Samsung Secure Folder
Since the root cause behind the “Shell does not have permission to access user 150” error is the Samsung Secure Folder, you can uninstall it to get rid of the issue.
- Go to Settings > Security and Privacy on your Samsung device.
- Tap More Security Settings.
- On the next screen, select Security Folder.
- On the Security Folder settings screen, select More settings.
- Finally, tap the Uninstall option and confirm the uninstallation.
- When the Samsung Secure folder is uninstalled, try running the ADB commands. It should run without throwing the command error.
Add ‘–user 0’ Argument to the ADB Commands
Another simple method to fix the command error is to use the ‘–user 0’ as an argument in your ADB command. If the Samsung Secure Folder is enabled, the ADB Shell commands are directed to ‘user 150’. By adding the ‘–user 0’ argument to your command, you can instruct ADB to bypass ‘user 150’ and direct the command to ‘user 0’, which is the ID of the main user in the Android system.
To make your ADB Shell command work while the Secure Folder is enabled on your Samsung device, add ‘– user 0’ to your command as shown below.
adb shell pm list packages -s --user 0
The command will be executed without any error.
Similarly, to uninstall an Android app package, use the command as follows:
adb shell pm uninstall --user 0 <package-name>
You can use the same workaround to fix the command execution error on Samsung devices without root privilege.