Reputation: 1223
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.
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.
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?
Upvotes: 4
Views: 10422
Reputation: 1199
I might be a little bit late but as I was searching on this topic I found this https://github.com/infinitered/reactotron tool very helpful, this not only displays the network traffic but also displays the errors in the application and state also
Upvotes: 1
Reputation: 620
Actually, now you can view network traffic using the react native network inspector introduced in version 0.33. I demo how to use the inspector in my video on how to make network requests in react native (starting at 1:46) http://codecookbook.co/post/how-to-make-network-requests-in-react-native/
Upvotes: -1
Reputation: 1223
Turns out using Charles is a good option.
Just set up the SSL certificates: Help > SSL Proxying > Install Charles Root Certificate in iOS Simulators) in charles and be happy!
Upvotes: 4