我一直在关注其他问题的说明,例如How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?(我在MAC上)和SSL Proxy/Charles and Android trouble,我可以使用Charles Proxy分析Android模拟器的数据包一直到Kitkat .
现在我'm trying to do the same for Lollipop emulators. However, when I repeated the same steps I used to successfully setup the Kitkat emulators, Charles show nothing! When I try to connect to the web using the emulator'的浏览器,它给出以下错误:
为了启用数据包嗅探功能,Mac OS X上的Android Lollipop仿真器是否需要特殊步骤?
提前致谢!
5 回答
我有同样的,最后找到出路:按照你提到的链接中的说明:How to configure SSL certificates with Charles Web Proxy and the latest Android Emulator on Windows?
然后从查尔斯进入“代理”菜单并启用“Mac OS X代理” . 比突然的东西来了 . 即使在我关闭'Mac OS X代理'之后......
ps:通过模拟器上的移动设置设置代理不起作用;代理设置必须通过命令行完成(sdk / tools中的模拟器命令,应该运行如下:
./emulator -avd Nexus_4_API_21 -http-proxy http://<your-ip-as-in-charles-help-menu>:8888
) . 我've also tried some proxy-apps like the proximator without any succes. Also I'已经有问题,并重新启动查尔斯修复它 .如果你不想使用命令行,你可以从模拟器执行此操作,它需要更多的设置,但工作得很好:
打开时会要求您设置一个引脚或确认它是否已经设置好
为证书命名
注意:我已经使用API 24仿真器对其进行了测试,但似乎可以正常工作,但它应该适用于其他版本 .
注意2:从Android Studio 3.0开始,在大多数情况下使用API> 21时将不再需要Charles,因为它将会出现:https://developer.android.com/studio/profile/network-profiler.html
在Android模拟器上进行调试时,在Mac上可能会非常单调乏味 .
按照步骤:
1)打开终端并转到SDK路径中的
tools
文件夹 .2)在终端上拖放名为
emulator
的文件(这样做会为您提供可执行文件的路径) .您的模拟器现在应该读取这样的路径
这里xxxx是您可以在Charles Help菜单中找到的IP地址 .
3)并执行此操作 .
瞧!您的模拟器现在将以代理网络模式启动 .
现在Android模拟器中有一个设置
这应该适用于大多数mac .