简体   繁体   English

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

[英]Android Studio cannot access adb to run a build

Noob warning. 新手警告。 I just installed Android Studio and I am trying to follow the "Build your first app" tutorial. 我刚刚安装了Android Studio,并尝试遵循“构建您的第一个应用程序”教程。 I created the project and was attempting to run. 我创建了该项目,并试图运行。 I created a VM but was then unable to see it in the "Select Deployment Target" screen. 我创建了一个VM,但随后在“选择部署目标”屏幕中看不到它。 Note that I can see the emulator image in the AVD screen, so it was created. 请注意,我可以在AVD屏幕中看到模拟器图像,因此它已创建。 It seems like adb did not start. 好像adb没有启动。 I can go to the terminal and run adb and it is installed and on my path, but Android Studio does not seem to see it. 我可以转到终端并运行adb,它已经安装并且在我的路径上,但是Android Studio似乎看不到它。 I got the following from the log. 我从日志中得到了以下内容。

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

I am on osx. 我在osx上。

First, move to your platform-tools directory 首先,移至您的platform-tools目录

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

Then kill server 然后杀死服务器

$ ./adb kill-server

Then restart the server 然后重启服务器

$ ./adb start-server

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

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