android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS on Xiaomi device

2.7k Views Asked by At

I couldn't really find proper solution for this problem. When I tried to run instrumented test on physical device (Xiaomi Mi Mix 2) I got an error that I need android.permission.INSTALL_GRANT_RUNTIME_PERMISSIONS to run it. But you can't really grant it from Android Studio since it's permission for system apps only. I couldn't really find solution for this problem so I tried to fix it by myself.

And finally found one.

On the device: Settings/Developer Options/USB Debugging(security settings)

When you switch it on it warns you that you should only use it if you really are a programmer since it lets any program that could connect to your device via USB get any personal data. But it did the job so I guess it is proper soultion.

Someone could tell me if it is safe or there is easier way to solve it? Mostly made this question so other Xiaomi users could find this thread useful.

0

There are 0 best solutions below