IPhone – Wirelessly debug Safari web app running on iOS using Safari on macOS

ipadiphonemac-mini

I need to plug an iPad/iPhone into a Mac Mini so I can debug web pages running ApplePay on them using the macOS Safari developer console.

Complication: The Mac mini is in a server cupboard three rooms away (considerably further away than the hard USB 5 metre limit). It runs headless and I VNC into it via my desktop PC.

So, how to connect the Apple devices without physically moving them? Is there some sort of wireless USB bridging device out there?

Currently installed software versions:

  • iOS: iOS 11.4.1

  • macOS: macOS High Sierra 10.13.6

  • Desktop Safari: Safari 11.1.2

Best Answer

Follow the instructions below one by one:

  1. On your iOS device, go to Settings app → Safari → Advanced and enable the switch for Web Inspector.

  1. On macOS, launch Safari and in the Menu bar, go to Preferences → Advanced and check Show Develop menu in menu bar.

  1. You will need to physically connect your iOS device to Mac mini using the Lightning cable once.

  2. Once the iOS device is connected, in Safari menu on macOS, enable Develop → Your device name → Connect via Network.

  3. Unplug the cable and check whether Develop → Your device name shows up in Safari on macOS.

  4. Safari app needs to be running and frontmost on your iOS device for it to appear under Develop menu in Safari on macOS.

The above configuration is demonstrated on devices running macOS High Sierra 10.13.6 and iOS 11.4.1 (latest version at the time of writing).