Question

I usually do a lot o development/testing on my local Mac / MAMP installation and then accessing it from my smartphone/tablet by just entering the proper IP address when the devices are on the same network.

However, I'm also often in a situation that I need to demo or test my web apps in places where there is no internet and my devices are not on the same network. What could I do then?

So again what I'd like to do is the following:

  1. Have my Mac acting as a local server (MAMP)
  2. Have my Mac (seemingly) act as a hotspot broadcasting a network via WiFi
  3. Be able to connect to that network (via WiFi) from my iPhone/iPad
  4. Access my Mac's MAMP local sites via the browser from my iPhone/iPad (without "Internet")

Again there is no "real" internet or other APs involved. It would be ideal if my Mac could also act as a DHCP server (so automatically assign IPs to devices connected via WiFi), but if thats too complex then I'll just enter the static IPs manually. BTW I don't need any fancy stuff like local domain names - just IPs are fine :)

Any ideas how one could accomplish something like this? If needed or it makes this workflow easier or quicker - I'm also not beyond buying other software to accomplish this.

BTW for example I had high hopes for this solution but it seems incomplete since my devices are still reporting that the network has no internet and are refusing to connect. Built in Mac connection sharing might also help somehow (not yet sure how?) but what connection to share if they're all offline?

Was it helpful?

Solution

I'll post my partial answer here - it will hopefully benefit somebody in the future.

In the end it was pretty easy:

  1. go to the Sharing panel in System Preferences, click on the Edit button by the first Computer Name edit box and then change the Local Hostname to something short, nice and readable (like for example web.local)
  2. click on the WiFi icon on you'r Mac's status bar menu and select Create Network... on the bottom of the menu, give your new WiFi network a name (+ other option if you'd like) and click create
  3. don't forget to fire-up MAMP (or any other server you might be using)
  4. and voila - you can now see the new WiFi network from your iOS/Mac devices, connect to it and use the previously created address (i.e. http://web.local) to access your MAMP server (my mistake previously was that I wanted to take the harder/universal way with local DHCP/DNS servers and IP addresses - but this is much easier and the OSX does everything for you)

Its unfortunately partial because it works only with Apple's Mac/iOS devices - other devices (have tried it with Android) will simply not see the personal network you've created (I assume details are being transmitted via Apple's Bonjour anyway so thats why). But better something than nothing.

But its still pretty cool - I can now connect my iPhone and iPad to the MAMP running on my Mac even without being connected to the Internet or having a DHCP-enabled AP taking care of the networking details.

OTHER TIPS

Just tested this to access my Glassfish server via WiFi in a classroom setting and what I find is that the created network does show up on Macs and Windows, however, while on Macs you can access the machine serving the WiFi by my_machine_name.local, Windows machines can only see the machine by specifying the IP. It is however interesting to note that once you use a machine as WiFi spot, it has apparently no IP assigned anymore (use ifconfig in the Terminal to check that). Still, if you ping your own machine, i.e. ping my_machine_name.local, then it will show in IP that can be used by machines connecting to the WiFi spot machine.

Go network Utility, and find your ip adress it will change your connection for example if you connect internet via network cable it will show in Ethernet(en0) or wifi it will be in wifi(en1) . It is your localhost ip you can access from phone or genymotion

have a nice day

Forget Wi-Fi. Forget internet sharing and tethering. When testing a server app running on a Mac from an iPhone or iPad, just use the USB cable! You don't even need an internet connection.

  1. Plug your iPhone or iPad to your Mac, using the USB cable.
  2. Run your server application on your Mac.
  3. Open Safari on iOS, and browse to your application, using your Mac's local network address found under Sharing in the System Preferences.

I still can't believe it but... it just works!™

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