讨论广场 问答详情
有关模拟器的问题
零露471 2024-11-03 17:46:24
69 评论 分享

 模拟器如何连接WiFi,并得到模拟器的ip地址??

 

69 评论 分享
写回答
全部评论(2)

您好,请问您的问题解决了嘛,如果已经解决,麻烦点击一下已采纳按钮

2024-11-05 10:43:27

模拟启动后,和真机一样可以通过hdc进行指令控制,所以可以通过ifconfig查看ip。具体例子如下:


C:\Users\ONE>hdc list targets
127.0.0.1:5555
37363634303665393561333906XXXXXX

C:\Users\ONE>hdc -t 127.0.0.1:5555 shell
$ ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 TX bytes:0

eth0      Link encap:Ethernet  HWaddr 52:54:00:XX:XX:XX
          inet addr:10.0.2.15  Bcast:10.0.2.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4121 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:431820 TX bytes:5178061

wifi_eth  Link encap:Ethernet  HWaddr 52:54:00:XX:XX:XX
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12811 TX bytes:6166

wlan0     Link encap:Ethernet  HWaddr 52:54:00:12:34:57
          inet addr:192.168.76.9  Bcast:192.168.76.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 TX bytes:0

其中192.168.76.9就是模拟器的ip。

如果有其他抓包需求请配置网络代理,使用方法如下

 

 

2024-11-04 10:28:36