小米手機不能直接運行Android Studio程式

來源:互聯網
上載者:User

標籤:span   ges   錯誤   block   apply   pack   app   小米手機   sage   

轉載自:http://www.jianshu.com/p/6588c69b42cfProblem description:

Android Studio升級到2.3版本之後,小米手機MIUI不能直接點擊Run運行Android Studio程式,報如下錯誤:

Installation failed with message Failed to establish session.
It is possible that this issue is resolved by uninstalling an existing version of apk if it is present,and then re-installing.

方法一 :設定Android Studio 中Instant Run中的選項為不選中
  1. 根據以下路徑,找到Instant Run中的選項
    File ——> Settings ——> Build, Execution,Deployment ——> Instant Run
  2. 將Enable Instant Run to hot swap code/resource changes on deploy(default enabled)的選擇框取消。

    Solution1.png
  3. 點擊Apply,儲存設定就OK了。
    這個時候就可以在小米手機上點擊Run直接運行程式了。
方法二:在手機的開發人員選項中關閉MIUI最佳化
  1. 進入到手機的開發人員模式,在最下面有一個啟用MIUI最佳化選項,關閉這個選項會提示重啟手機,選擇關閉並重啟重新啟動後,再次運行我們的程式,就可以在手機上運行了。

至此,由於升級2.3後預設開啟的Instans Run功能帶來的困擾即可解決~

小米手機不能直接運行Android Studio程式

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.