Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I want to do a demo of an iPhone optimised WebApp using my MacBook Air with a local server, so I don't have to depend on getting an internet connection or WiFi access from my client.

The Air is running Lion 10.7.2 and the iPhone is on iOS 5.0.1.

When I create a network on the Mac I can join from the iPhone, but when I open "http://my-macbook-air/" in Safari, it doesn't work.

Strangely it doesn't seem to utilize the WiFi, as the indicator never appears (but shows connected in the Settings app).

Possibly related: Why is my iPhone unable to connect to an ad hoc wifi network? (though my question is Apple <-> Apple, so I expected it to work).

share|improve this question
    
If the Wi-Fi indicator on the iPhone doesn't come it, it's probably not (fully) connected. How do you create the network on the Mac? –  patrix Dec 8 '11 at 20:18
    
I create it using "Create Network" from the WiFi indicator. –  User0812 Dec 8 '11 at 21:00
    
I don't get the WiFi connector either that way but can access the web server on the Mac with the IP address of the ad-hoc network. See below for a screenshot. –  patrix Dec 8 '11 at 21:07
    
Are you using the built in 'Web Sharing' feature of OS X? If not, what are you using? –  Jason Salaz Jan 8 '12 at 6:09
    
The URL should be http://my-macbook-air.local. As Jason points out you need to use 'Web Sharing' and be on the same LAN. –  afragen Feb 7 '12 at 16:30
add comment

1 Answer 1

It is probably related to resolving the host name.

Try using the IP address of the Mac instead of the name:

enter image description here

share|improve this answer
    
Using the Mac's IP didn't help (obtained from ifconfig). I assume Safari/iOS is not using the WiFi because it offers no internet connection? –  User0812 Dec 8 '11 at 21:01
    
Did you pick the right one? In my case it's en1 in ifconfig, you can also get it from Preferences/Network (see screenshot). –  patrix Dec 8 '11 at 21:16
    
Nope, using that IP (which is the same ifconfig gave me), doesn't work either. Tried the built-in apache and my dev server both to no avail. –  User0812 Dec 8 '11 at 21:20
    
This is really frustrating. I tried doing it the other way around, using the Mobile Hotspot, but then I get an indicator bar at the top that will stay there all the time, so whether or not they could connect that way, it's not feasible. –  User0812 Dec 9 '11 at 9:40
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.