以下的shell命令在Android 11设备上无法使用。有人可以帮我提供替代方案吗?
adb shell pm grant com.adobe.reader android.permission.WRITE_EXTERNAL_STORAGE
以下的shell命令在Android 11设备上无法使用。有人可以帮我提供替代方案吗?
adb shell pm grant com.adobe.reader android.permission.WRITE_EXTERNAL_STORAGE
adb shell appops set --uid PACKAGE_NAME MANAGE_EXTERNAL_STORAGE allow
Kotlin 工作代码
需要在 build.gradle 中添加的依赖项
androidTestImplementation "androidx.test:rules:1.3.0"
代码:
@get:Rule
val permissionRule: GrantPermissionRule = GrantPermissionRule.grant(
CAMERA, CALL_PHONE, READ_EXTERNAL_STORAGE,WRITE_EXTERNAL_STORAGE
)