Android Install on Device Failure [INSTALL_CANCELED_BY_USER]

I have same problem before, here is my solution:

Step 1: Go to "Setting" → find "Developer options" in System, and click.

Step 2: TURN ON "Verify apps over USB" in Debbuging section.

Step 3: Try "Run app" in Android Studio again!


Happens to my Xiaomi phone after updated it to MIUI 8. Took me hours to figure it out!

Check the followings if you're a victim too:

  1. Go to Settings -> Permissions -> Install via USB: Uncheck your App if it's listed.
  2. Go to Settings -> Additional Settings -> Privacy: Check the Unknown Sources option.
  3. Finally go to Settings -> Additional Settings -> Developer options: Check the Install via USB option.

Update (MIUI 8):

Signin in to MI account is required to enable Install via USB option.

Update 2

For some devices (e.g. Redmi) you might need to turn off MIUI Optimization and reboot your phone.

Settings > Additional Settings > Developer Options > MIUI Optimization

P.S. don't update MIUI unless necessary!

May the victims saved


Turn off Miui Optimizations on Developer Settings, then Restart the phone.