Android模拟器:如何监视网络流量?模拟器、网络流量、Android

2023-09-12 00:41:29 作者:在年少青春时

我如何监控网络流量,发送和从我的Andr​​oid模拟器收到?

How do I monitor network traffic sent and received from my android emulator?

推荐答案

有两种方法可以从Android仿真器捕获网络流量的直接

There are two ways to capture network traffic directly from an Android emulator:

复制并在模拟器上运行 ARM兼容的tcpdump二进制 ,输出写入到SD卡上,或许(如 tcpdump的-s0 -w /sdcard/emulator.cap )。

Copy and run an ARM-compatible tcpdump binary on the emulator, writing output to the SD card, perhaps (e.g. tcpdump -s0 -w /sdcard/emulator.cap).

运行模拟器-tcpdump emulator.cap -avd my_avd 来写你的PC上的所有仿真器的流量到本地文件

Run emulator -tcpdump emulator.cap -avd my_avd to write all the emulator's traffic to a local file on your PC

在这两种情况下便可以分析使用tcpdump或者Wireshark的正常的PCAP文件。

In both cases you can then analyse the pcap file with tcpdump or Wireshark as normal.