During Appium Android automation on Xiaomi devices there comes ‘Install Via USB’ popup every time execution is triggered. It can be handled using following steps,
- Signup with MI account on device if not already signed up
- Settings Screen > Additional Settings > Developer options > Turn off ‘Miui Optimizations’ option > Restart device
- Settings Screen > Security > Permissions > Icon at top right corner > Turn On “Install via USB” option
- Settings Screen > Additional Settings > Developer options > Turn On/Off “USB Debugging” > Turn On “Install vis USB” option
Trigger execution and pop-up will not come again.