即时运行后未显示设备选择器对话框 [英] Device chooser dialog is not showing up after instant run

查看:26
本文介绍了即时运行后未显示设备选择器对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android studio 2.0 中,在 emulator 上首次启动应用程序后,似乎附加了运行进程.但是,如果我连接设备并想测试应用程序,则不会显示设备选择器对话框.我尝试了即时运行、简单运行、检查配置(设置为显示选择器对话框),但所有更改均针对 emulator 应用程序进行.

In Android studio 2.0 after first app launch on emulator it seems that run process is attached to it. But if I connect device and want to test app, device chooser dialog is not showing up. I tried instant run, simple run, checked configurations (it's set to show chooser dialog), but all changes are made to emulator app.

如何在不关闭 emulator 并使用 emulator 丢失即时运行**connection**"的情况下在设备中启动应用程序?

How to launch app in device without turning off emulator and losing instant run "**connection**" with emulator ?

推荐答案

这种行为显然是一个缺陷,将在后续版本中修复,有一个 AOSP 的未解决问题.

This behaviour is clearly a shortcoming that's going to be fixed in subsequent releases, there's an open issue at AOSP.

现在我找到了两种不需要重启工作室或终止 adb 进程的解决方法:

Right now I found two workarounds that don't require studio restart or killing the adb process:

  1. 在您正在进行即时运行会话的设备上强制关闭应用程序.这样,会话将关闭,下次运行后系统会要求您选择设备.

  1. Force close the app on the device you have the ongoing instant-run session. This way the session will be closed and you will be asked to choose the device after next run.

如果您之前按下了运行"按钮,请按下调试"按钮,反之亦然.出于某种原因,从运行更改为调试或从调试更改为运行会强制 AS 关闭即时运行会话.

Press the "debug" button if you've pressed the "run" button before and vice versa. For some reason, changing from run to debug or from debug to run forces AS to close the instant run session.

这篇关于即时运行后未显示设备选择器对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆