Skip to content
midgeDocs
MobileHow to see console logs on iPhone Safari
Mobile

How to see console logs on iPhone Safari

How to view the console and network requests of a web page on iPhone Safari with Web Inspector on a Mac, and what to do without a Mac.

Safari on iPhone has no console of its own. To see a page’s console logs, turn on Web Inspector on the iPhone (Settings › Apps › Safari › Advanced › Web Inspector), connect the iPhone to a Mac, and open the page from the Develop menu in Safari on the Mac. You get the full Web Inspector for the iPhone’s page: console, network, elements and sources.

That’s the developer route. It needs a Mac and someone who knows Web Inspector, which is why “can you send me the console?” rarely works when a customer or a tester on a phone finds the bug. The end of this guide covers the alternatives.

What you need

  • An iPhone or iPad with the page open in Safari, or in an app that uses a web view the developer has made inspectable.
  • A Mac with Safari.
  • A USB cable for the first connection. After that, the Mac can also find the iPhone over the same Wi-Fi network.

Step 1: Turn on Web Inspector on the iPhone

  1. Open Settings › Apps › Safari (on iOS 17 and earlier, Settings › Safari).
  2. Scroll down and tap Advanced.
  3. Turn on Web Inspector.

Step 2: Show the Develop menu on the Mac

  1. Open Safari on the Mac and choose Safari › Settings.
  2. Click Advanced.
  3. Check Show features for web developers (older versions: Show Develop menu in menu bar).

A Develop menu appears in the menu bar.

Step 3: Connect and open the page

  1. Connect the iPhone to the Mac with a cable, unlock it, and tap Trust if the iPhone asks.
  2. Open the page you want to inspect in Safari on the iPhone.
  3. On the Mac, open the Develop menu, choose your iPhone’s name, and click the page.

Web Inspector opens on the Mac, attached to the page on the phone. As you tap around on the iPhone, messages appear in the Console tab.

Step 4: Capture the error

Web Inspector only shows what happens after it connects. If the error appears while the page loads:

  1. Keep Web Inspector open.
  2. Press Cmd+R in Web Inspector to reload the page on the iPhone.
  3. Reproduce the problem.

In the Console tab, filter to Errors to cut the noise. In the Network tab, failed requests show in red; click one to see its headers and response. To share the requests, export them as a HAR file. Our guide on getting a HAR file from Safari walks through that, and remove sensitive data from a HAR file explains what to strip before you attach it to a ticket.

Inspecting a web view inside an app

Pages shown inside a native app (a web view) appear in the Develop menu only if the app allows it. On iOS 16.4 and later, the app’s developer must set isInspectable = true on the WKWebView, usually only in debug builds. If you’re testing someone else’s app, ask its developers for an inspectable build.

Without a Mac

There’s no official way to read Safari’s console on the iPhone alone. The usual workarounds:

  • A debug console injected into the page, such as Eruda or vConsole, added by the site’s developers to a test build. It works, but it has to be in the page before the bug happens, and it isn’t something you put in production.
  • Remote logging set up by the developers, which sends errors to an error-tracking service. It catches crashes, but not the steps the person took.

Midge for iPhone

Midge for iPhone includes a Safari extension. Turn on Midge in Safari, record your screen, and the report comes with the page’s console messages, errors, network requests and clicks, lined up with the video. No Mac or cable needed, so a tester or a customer can send it. Passwords, tokens, cookies and card numbers are removed on the phone before anything is sent.

For your own native iOS app, the iOS SDK does the same for the app’s requests and log messages.

Troubleshooting

The iPhone doesn’t appear in the Develop menu. Unlock the iPhone, check that Web Inspector is on, and reconnect the cable. If the iPhone never asked to trust the Mac, try another cable or port.

The page is listed but Web Inspector is empty. Reload the page from Web Inspector with Cmd+R; it shows only what happens while it’s attached.