• 로그인 함 해보끄나?

  • Sarangnamu.net June 17, 2003
    Home Login Profile Study Open Project Q&A Google Code
    junit + runtime permission
    Last Modify : 10 May, 2019(08:31)
    https://stackoverflow.com/questions/41382575/how-to-request-permissions-on-android-marshmallow-for-junit-tests https://stackoverflow.com/questions/33929937/android-marshmallow-test-permissions-with-espresso @Rule public GrantPermissionRule permissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.CAMERA); @Rule @JvmField var permissionRule = GrantPermissionRule.grant(android.Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.CAMERA) @Before public void grantPhonePermission() { // In M+, trying to call a number will trigger a runtime dialog. Make sure // the permission is granted before running this test. if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { getInstrumentation().getUiAutomation().executeShellCommand( "pm grant " + getTargetContext().getPackageName() + " android.permission.CALL_PHONE"); } }

    Comment


    입력하3 1571745902



    Locations of visitors to this page