Xiaomi series mobile phone debugging Installation failed with message Failed to establish session

After Android Studio is upgraded to version 2.3, the MIUI of Xiaomi mobile phone cannot directly click Run to run the Android Studio program, and the following error is reported:

Method 1: Set the option in Instant Run in Android Studio to unchecked

1. According to the following path, find the option in Instant Run

<pre>File ——> Settings ——> Build, Execution,Deployment ——> Instant Run

2 Cancel the checkbox of Enable Instant Run to hot swap code/resource changes on deploy (default enabled).

Click Apply to save the settings and it's OK.

At this time, you can click Run on the Xiaomi phone to run the program directly.

Method 2: Turn off MIUI optimization in the developer options of the phone

1. Enter the developer mode of the mobile phone, there is an option to enable MIUI optimization at the bottom, closing this option will prompt to restart the mobile phone, choose to close and restart after restarting, run our program again, and it can be run on the mobile phone.

So far, the trouble caused by the default Instans Run function after upgrading 2.3 can be solved~

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326282691&siteId=291194637