title: Android Instrumentation Test Offline Cases
body: <p>For my instrumentation tests I am using Robotium. Mostly I am able to test everything but offline cases.</p>
  
  <p>As soon as I disable data (using adb, F8 shortcut in emulator, etc. ...) the test disconnects. It goes on in the device/emulator but no results are reported.</p>
  
  <p>So, I have got an idea to put just the app in offline mode and not the whole device. The problem is I don't know how...</p>
  
  <p>Using iptablesApi I would need to root my device. I have read that <a href="https://play.google.com/store/apps/details?id=com.netspark.firewall&amp;hl=de" rel="noreferrer">Mobiwol</a> app uses some kind of a VPN to restrict apps internet access without the need of rooting a device.</p>
  
  <p><strong>Question</strong>
  How does <a href="https://play.google.com/store/apps/details?id=com.netspark.firewall&amp;hl=de" rel="noreferrer">Mobiwol</a> app blocks the internet connection per application? Or is there another way how to test apks offline?</p>
  
  <p><strong>EDIT 12/30/2014</strong></p>
  
  <p>I forgot to say that I am able to run tests offline but I have to start tests when the device is in offline state. Currently, I divided my tests into OFFLINE and ONLINE ones. After running ONLINEs I execute the famous <code>adb kill-server</code> and <code>adb start-server</code>. After that I execute OFFLINEs. </p>