Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simulate low network connectivity for Android [closed]

This may sound a little crazy, but a microwave oven serves as a microwave shield. Therefore, putting your device inside a microwave oven (DO NOT turn on the microwave oven while your device is inside!) will cause your signal strength to drop significantly. It definitely beats standing inside an elevator...


You can use emulator for this. Take a look at this page: Android Emulator. Pay attention to next two arguments:

  1. -netdelay <delay>

    Set network latency emulation to . Default value is none. See the table in Network Delay Emulation for supported values.

  2. -netspeed <speed>

    Set network speed emulation to . Default value is full. See the table in Network Speed Emulation for supported values.

    Speeds for reference in increasing kbps:

                            UP       DOWN
                      -------- ----------
    gsm   GSM/CSD         14.4       14.4
    hscsd HSCSD           14.4       57.6
    gprs  GPRS            28.8       57.6
    umts  UMTS/3G        384.0      384.0
    edge  EDGE/EGPRS     473.6      473.6
    hsdpa HSDPA         5760.0   13,980.0
    lte   LTE         58,000.0  173,000.0
    evdo  EVDO        75,000.0  280,000.0
    full  No limit           ∞          ∞
    

Since iPhones developer option apply on wifi tethering, you can get an iPhone which has iOS 6 and above (and has been set to use for developments with the xcode), set it to emulate the desired network profile, connect your Android device to its hotspot

enter image description here


Update for Android Studio v 1.5 or greater
As @LouMorda mentioned in a comment below that the Emulator tab mentioned in original post has been removed in Android Studio v 1.5.

Now They've placed these settings in Simulator Settings in AVD Manager.
To access these settings:

  1. Select Tools -> Android -> AVD Manager
  2. Click the Edit AVD button (pencil icon)
  3. The Network Settings can be accessed after clicking the Show Advanced Settings button

Here is a screenshot of how it may appear:
Network Speed and Latency Settings in Android Studio v 1.5

Original Post
For anyone using Android Studio IDE:

  1. Go to Run -> Edit Configurations
  2. Select Android Application -> [Your App]
  3. Select Emulator tab
  4. Here you can change different values for Network Speed(internet speed) and Network Latency (delay) to simulate different speeds and latencies etc

Alternatively, you can enter various arguments in Additional command line options text field as mentioned in @inazaruk's answer.

The screenshot below describes how this Run Configuration screen looks like:

Run Configurations Screen in Android Studio beta 0.8.6

I know its a bit late to answer to this question, but i hope this helps others facing similar issues!

Edit
For anyone using eclipse, see @Abhi's answer below.