Question

Im working on an iphone web app using JQTouch , im just wondering what is the easiest way on snow leopard to be able to test my local code on my iphone? thanks

Was it helpful?

Solution

As long as your iphone is on the same network as your server it should be easy enough to type in the IP address or hostname of your machine into Safari Mobiles' location bar on the iPhone (or any other device).

Apples default server settings put the wwwroot at /Library/WebServer/Documents (Macintosh HD:Library:WebServer:Documents) But I personally think its a lot nicer to setup virtual hosts in apache and setup DNS to point to my server. In order for all that to work you need a domain name for which you can control the DNS and a router that lets you do port forwarding to your local server. This enables you to have multiple distinct projects on the same machine, each with their own unique url.

The easiest way however would be to store your files in /Library/WebServer/Documents, possibly in a folder named after the project you're working on.

Remember you also have a "Sites" folder in your home directory that you can use, You can get to that by typing http://your-computers-bonjour-name.local/~your-short-username/ into the location bar of any device on the same network that supports bonjour (previously rendezvouz).

OTHER TIPS

You can connect to your local machine using Zeroconf (aka Bonjour). So, if you laptop is named mylaptop, if you put your iphone on the same wifi network you can see your laptop at http://mylaptop.local. You can also see your ip address in the sharing settings in the System Preferences pane. You can then connect to the website using safari.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top