I am using Android Studio 2.2 Preview. I am facing the issue
Failure: Install failed invalid apk
Error: While installing apk,
Android Install on Device Failure [INSTALL_CANCELED_BY_USER] **Redmi Note 3
Go to Settings -> Permissions -> Install via USB: Uncheck your App if it's listed.
Go to Settings -> Additional Settings -> Privacy: Check the Unknown Sources option.
Go to Settings -> Additional Settings -> Developer options: Check the Install via USB option.
Go to Settings -> Additional Settings -> Developer options:Enable view attribute inspection
Finally Go to Settings -> Additional Settings -> Developer options:Turn off MIUI optimization.
NOTE - Signin in to MI account is required to enable Install via USB option.
Ref: http://en.miui.com/thread-410773-1-1.html