从Android模拟器捕获流量到localhost?

时间:2013-01-14 19:46:28

标签: android android-emulator fiddler

如何从Android模拟器捕获流量到本地网络服务器?我可以使用Fiddler吗?

谢谢!

1 个答案:

答案 0 :(得分:1)

由于EricLaws的评论,我发现了捕获流量的方法。

我必须使用reverseproxy并编写FiddlerScript规则。我添加了以下行

if (oSession.host.toLowerCase() == "10.0.2.2:8888") oSession.host = "localhost:8082";
OnBeforeRequest函数中的

。 在我的Android代码中,我使用地址10.0.2.2:8888来访问localhost:8082。效果很棒!