Android Studio无法访问adb以运行构建

时间:2018-11-03 02:25:49

标签: android android-studio adb

菜鸟警告。我刚刚安装了Android Studio,并尝试遵循“构建您的第一个应用程序”教程。我创建了该项目,并试图运行。我创建了一个VM,但随后在“选择部署目标”屏幕中看不到它。请注意,我可以在AVD屏幕中看到模拟器图像,因此它已创建。好像adb没有启动。我可以转到终端并运行adb,它已经安装并且在我的路径上,但是Android Studio似乎看不到它。我从日志中得到了以下内容。

7:10 PM Unable to open connection to: localhost/192.168.1.43:5037, due to: java.net.ConnectException: Operation timed out

7:10 PM Connection attempts: 6

7:11 PM Unable to open connection to: localhost/192.168.1.43:5037, due to: java.net.ConnectException: Operation timed out

7:11 PM Connection attempts: 7

7:12 PM Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.

7:12 PM * daemon not running; starting now at tcp:5037

7:12 PM * daemon started successfully

7:13 PM Unable to open connection to: localhost/192.168.1.43:5037, due to: java.net.ConnectException: Operation timed out

7:13 PM Connection attempts: 8

我在osx上。

1 个答案:

答案 0 :(得分:0)

首先,转到您的platform-tools目录

$ cd /Users/..../Android/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/

然后杀死服务器

$ ./adb kill-server

然后重新启动服务器

$ ./adb start-server