For example:
sending "A" from app to sever takes 5 seconds. Sever responds with "B" which takes 15 seconds to arrive at the app. In adb, we can add a network delay of 5000 and delay only the outgoing traffic for 5 seconds but how can I delay the incoming traffic for 15 seconds?
http://developer.android.com/tools/devices/emulator.html#netdelay shows how to pass command line arguments to the emulator in order to set network delay times. E.g.
emulator -netdelay gprs
or
emulator -netdelay 20000
which sets the round-trip delay to 20 seconds.
Usually the app only sees the total round-trip delay and doesn't notice if the request delay was different than the response delay. It might make a difference if client-server clock skew matters, or if other clients are also requesting changes to shared data, but the emulator doesn't provide a way to simulate that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With