[Reading Notes] iOS network-test and manipulate network traffic and ios network traffic
1. Observe network traffic.
The behavior of observing network traffic is called sniffing or packet analysis.
1. Sniffing hardware.
No special hardware or network configuration is required to capture data packets from the iOS simulator. To capture these packets, you can use the sniffer software to listen to the send-back device or the interface used to connect to the network.
2. Sniffing software.
OS x comes with the command line packet sniffer topdump, which is the basis of most other sniffer in OS X.
1) Use tcpdump for capture.
2) use Wireshark for capture.
2. Operating Network Traffic
1. Configure Charles
2. HTTP breakpoint.
3. Rewrite the rule.
3. Simulate the network conditions.
Network Packet Capture and HTTP Proxy tools are ideal for displaying network traffic visually. Another tool that should be available and familiar to all iOS developers in their toolbox is the network traffic modifier. It is used to simulate low-speed or unreliable networks.
1. OS X Line provides an excellent traffic modifier named Network Link Conditioner (NLC.
Reference: iOS network advanced programming-enterprise application development for iPhone and iPad