Skip to content

Andrey Butov Posts

Testing your mobile app against a server on the local network.

I often build mobile apps that have a web app counterpart. Typically, during development, the web app is running on some local machine, while the mobile app is being tested on a device.

A common issue that arises with this setup is that the mobile app, being tested on a device, doesn’t know the host name of the machine where the local web app is running.

With web development, I would set up a hosts file on each machine, to let it know how to reach the other hosts. But with a mobile app, I can’t simply modify the hosts file on the device (well, you can, but you would need a jailbroken device).

There are various solutions to this, such as modifying your router settings, but I find it easier to just use an HTTP proxy.

Here is how I would test an iOS app, with a web app counterpart running on a local Windows machine named “athena”.

If I just run the web app on “athena”, and then run the iOS app on my iPhone, the iOS app would not be able to connect to the server running on “athena”, as the iPhone doesn’t know what or where “athena” is.

The idea here is to run an HTTP proxy on “athena”, and then have the iPhone route its network traffic through the HTTP proxy. Since the HTTP proxy runs on “athena”, it can read the hosts file on that machine, which has an entry pointing the name “athena” to something like 127.0.0.1. So, when the iPhone routes its network traffic through the proxy, the proxy can then resolve the name “athena”, and direct the request to the web app being served there.

It’s worth noting that the HTTP proxy does not need to run on the same machine as where the web app is running. The proxy can run on any local machine, as long as that machine has a hosts file with an entry for the location of the machine from which the web app is being served.

For Windows, the HTTP proxy I like to use is Fiddler.

After installing Fiddler, I go into options, and make sure “Act as system proxy on startup” is checked, and that “Allow remote computers to connect” is checked.

fiddler1

After that’s done, I go into the File menu and make sure “Capture traffic” is checked.

Fiddler is a great option on Windows. There are also great options for setting up local HTTP proxies on a Mac, such as the Charles HTTP proxy.

Once my HTTP proxy is running, it’s time to configure the iPhone to use that proxy. I will need to know the IP address of the machine where the HTTP proxy is running. In my case, the proxy is running on “athena”, which has the local IP address of 192.168.1.11. The Fiddler proxy is listening on port 8888 (this can be seen in the Fiddler settings dialog).

On iOS 7, to set the proxy, I go into Settings, then, Wi-Fi, and select my Wi-Fi network. I scroll toward the bottom of that screen to find the section for HTTP PROXY. I click on “Manual”, and enter the IP address (Server) and Port of the machine on which my HTTP proxy is running. I entered 192.168.1.11 for the Server, and 8888 for the Port.

proxysettings

That’s all. Now, when I run the mobile app on my iPhone, and the app wants to connect to the web app on “athena”, the network request is routed to the Fiddler HTTP proxy running on 192.168.1.11:8888, the proxy reads the hosts file, finds the entry for “athena”, and directs the traffic to the correct local machine.

This is an easy way to test your mobile apps against local web servers. Just don’t forget to disable the local HTTP PROXY setting on your iPhone before you leave the house!

If you make mobile apps for a living, check out Uberdeck. It’s a service we started to allow mobile app developers to make more money from their apps, and to prevent negative reviews.

Comments closed

Essential Voice Recorder

My latest app, Essential Voice Recorder, is a voice recording application for Android. The application also allows users to take written notes while recording their lectures, office meetings, etc.

The application will be available in the various Android markets within the next few days.

Comments closed

Uberdeck Private Beta

Uberdeck is now in private beta.

If you’d like to try Uberdeck while it’s in beta, send an email to support@uberdeck.com , and we’ll set you up with an account.

If you want to follow the discussion around the development and launch of Uberdeck, subscribe to the Bootstrapped.fm podcast, which I co-host with Ian Landsman of Userscape.

Comments closed

Uberdeck

Today, we pulled back the curtain on our next product: Uberdeck.

Uberdeck is a service that allows mobile app developers to send marketing campaigns straight to their mobile apps, letting them reach their mobile app users directly, for cross-selling new apps, providing notifications of upcoming features, etc.

With traditional desktop applications, software vendors have long been able to generate significant revenue by selling new products, or new versions of existing products, to their existing customers. One way this was done was by sending an email marketing campaign, perhaps using a service like Campaign Monitor, to their customer list.

With mobile apps, this avenue of marketing is largely nonexistent, as the app users interact with the mobile app stores almost exclusively, and there is rarely an open channel of communication between the app user and the app maker.

Uberdeck attempts to fill this gap, giving mobile app developers an opportunity to create a more direct way to market to their existing customers.

Uberdeck has been in development for quite some time. We are now entering beta, and are accepting signups for the private beta launch.

More info is available at www.uberdeck.com

Comments closed

Ethan’s 1st birthday.

Throwing a birthday party for a 1 year old isn’t so much about throwing a party, as it is about finding a delicate balance of variables that will keep one baby, two dogs, and a handful of over-enthusiastic adults happy for a short while.

 

Mommy made a smash cake for us – Ethan’s favorite color (mine too).

 

Ethan being all 1 and stuff.

 

A good time was had by all!

Comments closed