In iOS development we have the need to test the running state of the app in a variety of different network states. Apple provides us with software that simulates various network states in both the simulator and the real-state.
In the simulator
The official website address of the simulated network status provided by Apple
To download the tool you need to sign in to your Apple ID and choose a different version depending on your needs.
Select, click Network Link conditioner.prefpane to run
Options for this tool appear in System Preferences
The network status for the different options.
- Preset Profiles Preset Network status
| Configuration |
Description |
| 100%loss |
All lost Packets |
| 3G |
3G Network |
| Dsl |
Telephone Line internet access |
| Edge |
2G Network |
| High Latency DNS |
High Latency |
| Very Bad Network |
Network condition is not stable |
| Wifi |
WiFi internet |
- Custom Profiles Customize the network status.
Note: The tool is globally valid and works for the entire system if a certain network state is turned on. So when you finish testing the app, close it in time.
Real Machine
Apple has a network debugging tool provisioned in the iOS system, but only if you have added a test device and you use Xcode to connect the device to activate it.
- Before Xcode is connected
After Xcode connects, find out one more of the settings: developer
Select Status
The options inside are the same as those on the Mac.
Note: The developer option is also valid for the global, and if a certain network state is turned on, it is valid for the entire system. So when you finish testing the app, close it in time.
Other
Network analysis artifact Charles can also be used to simulate network status. For the use of Charles, please visit here personally, Apple's own tools have provided us with powerful features and are easy to use. Wouldn't it be overkill to use Charles? Of course Charles's strength is undeniable, not in this form.
Original link (poke here):> http://www.jianshu.com/p/b12cee51c883
iOS simulates various network states