That's the way real networks behave, and what real users have to manage with.
Yes it is perfectly possible, but it’s very difficult. Having just gone through this process I can attest that this is not something the average “app developer” is going to be capable of doing, at least on Linux and Windows.
The raw tools are there, but they are complicated, poorly documented, and require network engineering knowledge on top of software development knowledge.
Probably there is some nice package to wrap up the whole “generate a virtual network and add latency + packet loss between these two end points”, I just never found it.
Linux has a built-in command: trickle
https://linux.die.net/man/1/trickle
https://stackoverflow.com/questions/10328568/simulate-limite...
As for how hard it actually is: iOS has already been explained, the Android emulator has network latency and speed simulation right in the GUI, as do most web browsers. And there's alway the option to switch your phone to 2G only in the settings and/or go into the basement or elevator.
This is the real problem - there are deadlines and most projects don't even consider working in questionable network conditions. Developers aren't going to put in the extra effort when it doesn't contribute to the job they are asked to do.
I always at least _ask_ in the requirements gathering stage for a new mobile app: "how much effort do we want to dedicate to app performance/reliability under marginal network conditions?"
As it turns out, pretty much all mobile app owners are as apathetic about that as most mobile app developers. (On the other hand, once you've got a reputation for being able to handle those sorts of flaky network edge cases, you get more and more work for the sort of apps that benefit from them. The downside of that is it's never the flashy resume-building-apps that come to you for this.)
shrug
Disagree, it's no harder than any other linux subsystem, you can use `tc` or you can attack it a different way by using virtualization then messing with it at the vde layer. I've added storage and network random latency for testing code before, took a day or so to get working perfectly, but now it's in a shell script.
Hm, alternatively.... you're right, it's very difficult. You should hire a software engineer, such as myself, to do it for you. ;-) ;-)
Both Firefox and Chrome dev tools also have built in throttling of network connections. https://blog.nightly.mozilla.org/2016/11/07/simulate-slow-co...
The tools exist and they're easy to use. Most people just don't bother.
Well, I sure wish Apple would make use of that functionality themselves once in a while.
It's frustratingly impossible to enqueue an iMessage message while out of signal and have it be automatically delivered once back in cell coverage. Bizarrely WhatsApp, a third-party application (with all the background execution restrictions that go with that), manages to do just that!
FWIW, it's perfectly possible to simulate arbitrary levels of bandwidth/latency with a variety of tools even while having a fiber connection. For example, Macs have long had the "Network Link Conditioner" tool as a free utility included with the Additional Tools for Xcode package, which then allows simulating configurable bandwidth, latency, and packet loss. There are similar tools for Linux as well, tc is powerful. Most firewalls with quality traffic shapers also allow at least the first two at the network level, I used that on OPNsense to simulate a VSAT connection with 750ms latency and 4/.5 to a specific VLAN so that we could just connect systems and then see how applications worked. It's been awhile but it was eye opening. A nice thing about that approach is that then you can just connect devices to a given VLAN, which makes testing back and forth super easy. Wired is trivial of course, have a switch where each port is a different test VLAN, but even for wireless if you have WAPs that support PPSK/MPSK, then hopping between test VLANs just means reconnecting with a different password. Simulating packet loss with a network device seems the be more niche and complicated and I don't know if any firewalls put a GUI on it. tc queue disciplines can be used though so any Linux device with two network ports can sit inline and modify the traffic to simulate loss/latency, an RPi would be fine for that.
I agree it'd be nice if more app developers would test under less than ideal conditions, particularly since it's so trivial to do so. I think most simply don't think about it though, same as many GUIs (web or local) not testing for stuff like various types of color blindness.