1

Goal: I want to handoff my localhost site to my phone for testing. I can access my localhost by going to http://my.ip.add.ress/localhost on my iphone. Of course, on my computer the actual address is just http://localhost. Instead of typing that address I want to trigger a script that will "handoff" the concatenation of my computer's ip address + localhost/page.

My question is if I can trigger a "handoff" through applescript or command-line. Is there a handoff API?

I'm not asking about how to get my computer's ip address.

  • After writing this I searched "handoff API" and found these docs: developer.apple.com/library/content/documentation/…, way more complicated than I was hoping for. – icicleking Feb 18 '17 at 13:29
  • What about just using http://my.ip.add.ress/localhost/page or servername.local/page instead of localhost on your computer? Handoff will work automatically then.. – Asmus Feb 18 '17 at 13:49
1

You can probably avoid all the hassle by just using one nice service - http://xip.io

Instead of browsing to http://localhost - look up your IP and browse to http://192.168.12.13.xip.io/

Of course, your actual IP address for the local host is needed unless your router was set up to assign your test Mac 192.168.12.13 - even though you aren't asking how to get your IP, that's the key to making this easy for safari to hand off the session from macOS to iOS.


Does xip.io cost anything?

Nope! xip.io is a free service from Basecamp, the creators of Pow. We were tired of jumping through hoops to test our apps on other devices and decided to solve the problem once and for all.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .