Use Fiddler to simulate weak network environment and test APP performance

In many cases, we need to simulate different network environments to check the product's response. We can use the Fiddler tool to control.
The specific operations are as follows:
1. Check the ip
win + R on your PC , enter cmd to open the background commander, and enter ipconfig to view your IPv4 address

2. Determine the port that your Fiddler listens to, generally the default is 8888

3. The mobile phone is connected to wifi and then to the agent, ip is its own IPv4 address, and the port is 8888. Operate on the mobile phone to see if Fiddler can catch the package, if there is, the agent of the mobile phone and the computer is successful

4. Set Fiddler's internet speed.
Insert picture description here
Find the following code and set the internet speed you want to simulate:

    if (m_SimulateModem) {
        // Delay sends by 300ms per KB uploaded. //每延迟300ms发送1kb的数据,也就是每1s发送10/3kb的数据
        oSession["request-trickle-delay"] = "300"; 
        // Delay receives by 150ms per KB downloaded.//每延迟150ms下行1kb的数据
        oSession["response-trickle-delay"] = "150"; 
    }

Modify the value, for example, oSession ["request-trickle-delay"] = "300"; Modify to 1000, the greater the value, the longer the time to send 1kb of data is the difference in network speed.

5. Enable the speed of the set Fiddler analog modem
Insert picture description here
6. Continue to operate the phone, you will see that the data will be pulled very slowly, proving that you have successfully simulated in a weak network environment! ! !

Published 22 original articles · praised 5 · visits 4318

Guess you like

Origin blog.csdn.net/weixin_42231208/article/details/96500081