Android 模拟器:如何监控网络流量? [英] Android emulator: How to monitor network traffic?
问题描述
如何监控从我的 android 模拟器发送和接收的网络流量?
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
).
运行 emulator -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.
这篇关于Android 模拟器:如何监控网络流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!