• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

gisoracle

  • 博客园
  • 联系
  • 订阅
  • 管理

公告

View Post

小米手机不能直接运行Android Studio程序

小米手机不能直接运行Android Studio程序

转载自:http://www.jianshu.com/p/6588c69b42cf
Problem 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功能带来的困扰即可解决~

posted on 2017-06-25 11:08  gisai  阅读(248)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3