Android Studio互联网连接 [英] Android Studio internet connection

查看:95
本文介绍了Android Studio互联网连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试连接到Android Studio上的本地主机

I'm trying to connect to localhost on Android Studio

我尝试了:localhost,127.0.0.1,10.0.2.2:8080

I tried : localhost, 127.0.0.1, 10.0.2.2:8080

但是我仍然得到相同的答复:

But I'm still getting the same response:

failed to connect to /10.0.2.2 (port 8080): connect failed: ECONNREFUSED (Connection refused)

我在线上发现( Android与本地主机的连接),在月食中,您应该首先绑定ip进入eclipse设置.

I found online (Android connection to localhost) that in eclipse you should first bind the ip in eclipse settings.

但是我不知道如何在Android Studio中做同样的事情

But I can't figure out how to do the same in Android Studio

推荐答案

您无法使用真实设备连接到本地主机(127.0.0.1或10.0.2.2).一个简单的解决方案是确保您的计算机和android设备连接到同一网络(WiFi/托管热点),然后使用计算机的IP地址进行连接.

You can't connect to your localhost (127.0.0.1 or 10.0.2.2) using a real device. An easy solution is to make sure that your computer and android device are connected to the same network(WiFi / Host a hotspot) and then use the computer's IP Address to conect.

这篇关于Android Studio互联网连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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