Android中AndroidJUnit4 运行单元测试时报错,
错误是:
Installation failed due to: ''cmd package install-create -r -t --user current --full --dont-kill -t -g -S 7871513' returns error 'Unknown failure: Security exception: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag
java.lang.SecurityException: You need the android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS permission to use the PackageManager.INSTALL_GRANT_RUNTIME_PERMISSIONS flag
解决方案:
开发者选项中,开启USB调试既可解决这个问题