如何在 iOS 上的 React Native 应用程序上检查网络流量? [英] How do I inspect network traffic on a react native app on iOS?

查看:55
本文介绍了如何在 iOS 上的 React Native 应用程序上检查网络流量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用最新的 React Native(在撰写本文时为 0.18)并且想检查我的 iOS 模拟器发出的网络请求.使用最新的 Xcode工具"我得到了这个: .我在 10.11 和 10.10 机器上都遇到了同样的错误,两者都使用最新的 Xcode.

I'm using the latest React Native (0.18 at the time of this writing) and would like to inspect the network requests my iOS simulator makes. Using the latest Xcode "instruments" i get this: . I get the same error on both 10.11 and 10.10 machines, both using the latest Xcode.

我也尝试过使用 Charles,但它无法拦截流量.Wireshark 能够看​​到它,但我要查看的数据是基于 SSL 的,因此我无法访问它.

I've also tried using Charles, but it's unable to intercept the traffic. Wireshark is able to see it, but the data I'm after is SSL based, so I cannot access it.

作为一名 web 开发人员,理想情况下我想在我的 chrome 调试器中检查网络流量,但我知道这在这种环境中是不可能的,但是仅仅查看原始数据包数据对于调试目的来说不够用户友好.

As a webdeveloper, ideally I'd like to inspect network traffic in my chrome debugger, but I understand that this cannot be possible in this kind of environment, but simply looking at raw packet data is not userfriendly enough for debugging purposes.

谁知道这个问题的解决方案?

Who knows of a solution for this?

推荐答案

事实证明,使用 Charles 是一个不错的选择.

Turns out using Charles is a good option.

只需设置 SSL 证书:Help > SSL Proxying > Install Charles Root Certificate in iOS Simulators) in charles and be happy!

Just set up the SSL certificates: Help > SSL Proxying > Install Charles Root Certificate in iOS Simulators) in charles and be happy!

这篇关于如何在 iOS 上的 React Native 应用程序上检查网络流量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆