简体   繁体   English

来自Android Studio和终端的adb不能同时使用

[英]adb from Android Studio and terminal are not usable simultanously

I'm using Linux Mint and I have an annoying problem with my adb: 我正在使用Linux Mint,我的adb有一个恼人的问题:

I can use adb either from Android Studio (Android Monitor) or in terminal, but not both at the same time. 我可以使用Android Studio(Android Monitor)或终端中的adb,但不能同时使用两者。 Even the Android Studio Terminal found no devices if Android Monitor in Android Studio was running. 即使Android Studio终端在Android Studio中运行Android Monitor时也没有找到设备。

The workaround is to exit Android Studio and type 'adb kill-server' in terminal. 解决方法是退出Android Studio并在终端中键入“adb kill-server”。 After that I can use adb in terminal, and when I'm ready with my custom commands I have to restart Android Studio. 之后我可以在终端中使用adb,当我准备好使用自定义命令时,我必须重新启动Android Studio。

I have activated Tools -> Android -> Enable ADB Integration. 我已激活工具 - > Android - >启用ADB集成。

Any ideas to use adb through terminal even when Android Studio is running? 即使Android Studio正在运行,任何想通过终端使用adb的想法?

Make sure that you are using single instance of adb . 确保您使用的是adb单个实例。

You are, most probably, using two instances of adb . 你最有可能使用两个adb实例。 With a single instance of adb , I can use it from external terminal, Android Studio terminal, and build/run projects from Android Studio simultaneously without restarting anything. 使用单个adb实例,我可以从外部终端,Android Studio终端使用它,同时从Android Studio构建/运行项目,而无需重新启动任何内容。

To verify if you are using single instance of adb run 验证您是否使用单个adb运行实例

$ which adb

or 要么

$ type adb

from external terminal and one from Android Studio, and make sure they both are pointing to the same adb . 来自外部终端和Android Studio中的一个,并确保它们都指向同一个adb

Hope this helps. 希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM