ios http 抓包工具mitmproxy 模拟器及真机使用。

这个配置还是很方便的,模拟器也可以实现抓包Fidder  与 Charles 可以实现,但是感觉配置太麻烦了些。还要收费啊哈。。。

注意 

1. 安装好后要运行:mitmproxy -p 8080 (-b 10.0.0.2 加本地地址)否则插件安装到手机会不成功。

2. port 就是http的端口号,如果mac 与mitmproxy 在一台机器上会有问题,因为端口会被占用而不能测试,所以服务器要与mitmproxy 在不同的机器上测试。

Use mitmproxy for iOS app network testing



mitmproxy is an interactive console program that lets developers monitor network traffic flow. It is very useful for iOS networking debugging and testing because you can inspect requests and responses of all network traffic on a real device or a simulator. I will list the steps to use this tool.

  1. Install mitmproxy on a Mac

    use this command to install mitmproxy

    pip install mitmproxy
    

    After I run this command, and I run into “no attribute ‘TLSv1_2_METHOD’” issue. I followed one instruction of this issue and solved this problem. The approach is as the below.

    sudo mv /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/OpenSSL /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/_OpenSSL
    
  2. Set proxy on a Mac

    After mitmproxy is installed, you can run mitmproxy to start the proxy sever. If you want to use this proxy server on a iOS simulator, you need to update your network setting on your mac. The proxy server is your mac IP address.proxy setting on mac

    Next visit http://mitm.it to install a certificate, then you can see all network traffic including iOS simulators on a mitmproxy console.

  3. Set proxy on an iPhone

    First go to iPhone WIFI setting, and then set your proxy server

    proxy setting on mac

    After the proxy server is set, and then open Safari and visit http://mitm.it. Install a profile by clicking the Apple icon when you can see the screen below.

    mitmproxy website install profile

    After you have done the steps above, you can see all iPhone network traffic on a mitmproxy console.
    mitmproxy

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值