Android模拟器未连接到互联网

sri*_*lli 5 networking android emulation

我正在使用TATA PHOTON PLUS.Android模拟器浏览器无法连接到互联网."网页不可用"消息即将发布.我们是否需要进行任何设置才能连接到互联网?请帮忙.

Lal*_*ani 24

 ...\android-sdk-windows\tools>
Run Code Online (Sandbox Code Playgroud)

并写下以下内容并检查

emulator -avd your_avd_name -dns-server 8.8.8.8
Run Code Online (Sandbox Code Playgroud)

在应用这些步骤之前,不要忘记关闭以前运行的AVD.希望它对你有用谢谢.


ane*_*los 5

在 Windows 下,您可以更改网络适配器索引,因此“互联网”适配器是第一个。

假设您使用 wifi 适配器连接到互联网。您必须打开 PowerShell(以管理员身份)并执行命令:

netstat –r -n
Run Code Online (Sandbox Code Playgroud)

EDT:目前,在 Windows 10 版本 19042.964 上,我必须使用 PowerShell (x86) 才能运行上述命令

除其他事项外,您将获得网络适配器列表,即:

Interface List
 18...f0 bf 97 04 da f1 ......Realtek PCIe GBE Family Controller
 30...16 27 37 af c7 99 ......Microsoft Wi-Fi Direct Virtual Adapter
  4...64 27 37 af c7 99 ......Qualcomm Atheros AR9285 Wireless Network Adapter
  7...64 27 37 af c7 9a ......Bluetooth Device (Personal Area Network)
  1...........................Software Loopback Interface 1
 10...00 00 00 00 00 00 00 e0 Microsoft Teredo Tunneling Adapter
 19...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
Run Code Online (Sandbox Code Playgroud)

运行命令

Set-NetIPInterface –InterfaceIndex "4" –InterfaceMetric "1"
Run Code Online (Sandbox Code Playgroud)

您可以将 wifi 适配器移至列表顶部,这将解决问题。

再次运行“netstat –r -n”命令来验证它。