React-Native simulate device is disconnected

Turning genymotion (or device) wifi causes app be unable to connect to app bundle and goes to show the red error in react-native. So how can I simulate app behavior when is disconnected from the internet (and also developing to have a good react (I mean it's not just about testing, also developing))?

1 answer

  • answered 2018-04-17 04:20 Kirill Glazunov

    There are only 4 states possible:

    1. connected with good connection (have access to remote servers)
    2. connected with poor connection (loss percentage is high)
    3. connected with zero connection (have not access to remote servers - 100% loss)
    4. not connected

    Simulations way depends on which situation you need and where your app is running (device:iOS, Android?, simulator: mac, windows?)

    On iOS you have Developer menu in the preferences and Network Link Conditioner in. On Mac you can install Network link conditioner by this

    I`m sure android has some tool for it. Can`t say something about windows, sorry