该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

装了androidSDK后,无法直接上网,用的局域网的PPOE方式连接的

个人电脑的连接信息如下

Ethernet adapter

本地连接:

Connection-specific DNS Suffix . : router

IP

Address. . . . . . . . . . . . : 192.168.1.102

Subnet Mask . . . . .

. . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . :

192.168.1.1

DNS Servers . . . . . . . . . . . : 192.168.1.1

PPP adapter

sss:

Connection-specific DNS Suffix . :

IP Address. .

. . . . . . . . . . : 10.0.0.9

Subnet Mask . . . . . . . . . . . :

255.255.255.255

Default Gateway . . . . . . . . . :

10.0.0.9

DNS Servers . . . . . . . . . . . :

10.0.0.9

运行

adb

shell

getprop

后显示:

[net.eth0.dns1]:

[10.0.2.3

[net.gprs.local-ip]: [10.0.2.3]

[net.dns1]:

[10.0.2.3]

将这两个属性改成跟电脑的配置一样

运行

setprop net.eth0.dns1

10.0.0.9

setprop net.gprs.local-ip 10.0.0.9

setprop net.dns1

10.0.0.9

查看一下结果

getprop

[net.eth0.dns1]:

10.0.0.9

[net.gprs.local-ip]: 10.0.0.9

[net.dns1]:

[10.0.0.9]

修改成功。

命令行里输入

exit

退出shell,然后再试下虚拟机,可以正常上网了。

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐