'Network speed setting not working on Android emulator

I want to emulate different network speeds with Android emulators.

I tried the -netspeed option. Also tried the network type setting in the extended menu controls.

But it does not work as expected. Either the speed is very fast, or it's incredibly slow. No in-between.

For example with -netspeed 12000 a page loads in less than 2 seconds. But with -netspeed 11000 it loads in more than 2 minutes!

Same difference if I switch between HSDPA (3G) and LTE.

I work on Linux Lubuntu 18.04.

Is it a bug or did I miss something?



Solution 1:[1]

I feel like I'm having similar issues, and I strongly suspect that the speeds in the emulator are reversed. That is, upload speed is actually download speed and vice versa. My app does very little uploading, its mostly downloading.

I use telnet and 'network speed 1000:100000', which should set the upload speed to about 122 KB/s, and download about 12200 KB/s. I use 'network status' to check, and it verifies that my settings were applied correctly to the download and upload speed, however my app crawls despite a reasonably high download speed. If I reverse the speeds (network status 100000:1000), it flies. In fact if I over-exaggerate and make the download speed only 10 (1.2 KB/s), and leave the upload speed at 100000, it still flies. This should kill my app.

If I'm correct, I suspect that all the speed limits used when a network type is selected in the emulator's settings are incorrect also.

Solution 2:[2]

My testing of network types also revealed the same issue where the network status (upload and download speeds) appear to be reversed. I had set the network type to HSDPA up: 5760.0 down: 13980.0 resulting in noticeable delay when loading google's top news. I then set network type to num specifying 13980.0 for both up and down. This changed the displayed network status upload speed from 5760.0 to 13980.0 and the browser page loading was now immediate. There should not have been any effect from this change, so I have to concur a problem exists.

After additional testing, I can confirm the network type setting under Android Studio emulator Extended Controls is implemented backwards (upload is download speed and download is upload speed). I have also confirmed the emulator network status command upload and download speeds are reversed.

Solution 3:[3]

I believe that's because you are missing HTTPS in the new domain so the browser is skipping some resources it considers insecure to load over non-HTTPS. Fix your HTTPS certificate situation and this problem should go away.

Solution 4:[4]

I used the inspect element to see the source code and saw that the div with the id (pg1Overlay) had the style

width: 100%;
height: 100%;
position: absolute;
z-index: 1;
background-color: rgba(0,0,0,0);
-webkit-user-select: none;

So, I changed it to

width: 100%;
height: 100%;
position: absolute;
z-index: 1;
background-color: blue;
-webkit-user-select: none;

and then the page was blue.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mikecamimo
Solution 2 Community
Solution 3 enapupe
Solution 4 Tyler2P