To grant an Android app "All files access" (MANAGE_EXTERNAL_STORAGE) via ADB, use the following command:
bashadb shell appops set --uid PACKAGE_NAME MANAGE_EXTERNAL_STORAGE allow
Replace PACKAGE_NAME with the actual package name of your app (e.g., com.example.myapp). This command directly grants the permission without user interaction, but note that the app must declare the MANAGE_EXTERNAL_STORAGE permission in its manifest for this to work.
If you want to prompt the user to grant the permission manually (for example, to open the settings page where they can enable it), you can use this intent:
bashadb shell am start -a android.settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION -d package:PACKAGE_NAME
This will open the system settings page for that app, where the user can toggle "Allow access to manage all files".
This Chat is read-only. Login to resume chatting.