Working with Mobile Phones

Mobile Debugging

We’ll do some quick tips for debugging mobile web apps with Rails.

Chrome Debugger

First, you should know about the Chrome debugger, but know that it is limited.

Xcode or Android Simulator

Second, you should install Xcode or Android development environment and run the simulators.

Using the latest versions of Puma that Rails ships with, you need to know that the standard Rails start, whcih is

bundle exec rails s

Will launch your app at 127.0.0.1:3000. Most days that’s fine for local development.

But today you want to load your app from your iPhone or iPad that’s running at its own IP address but on the same network as your local development server.

The normal way that Rails runs won’t be accessible accross the network.

You need to tell Rails to bind to the IP address 0.0.0.0 which allows it to be accessible from your local machine and from peers on the network (like your iPhone or iPad)

bundle exec rails s -b 0.0.0.0