Aug 29, 2010 / iphone
iPhone Tip: Test Your App Unplugged

Developing your app with a speed limiter is a great way to make sure your User eXperience isn't suffering because of connectivity problems in the wild.

However, you also want to go one step further and test the entire app without any internet connection. This way you can make sure you give the appropriate messages to your users when your app is unable to grab the latest data.

The easiest way to do this is to unplug your OSX network connection. This is your best option until the simulator eventually gets an "offline" mode.

To make this easy for me, I have a Rakefile for switching the network on and off.

> rake offline

And

> rake online

The Rakefile.rb is very simple.

require 'rubygems'
require 'rake'

desc "Take network down for simulated offline mode"
task :offline do
  `sudo ifconfig en0 down`
end

desc "Put network up for online mode"
task :online do
  `sudo ifconfig en0 up`
end

You can then take your network offline, run the simulator, and make sure everything is cool.


You may also like...