Skip to content
All writing ‹ Part 06 of 11 · Mobile Debugging: When There Is No DevTools
Engineering · 4 min read

Where Did It Fail? The Device Log and the Network Log Each See Half

On a phone, the key step after a tap can happen with no network request. Why the HAR and the device log each see half, and which one proves each claim.

On the web, a link usually opens in a tab, so the Network panel sees it. If you need the OS log, it is on the same computer. On a phone, the most important event after a tap can happen without any network request.

Two recorders, two worlds

Device log and HAR The device log records what happens on the phone. Only network traffic goes through the proxy into the HAR. Device log, on the phone OS opens an app or a link app's own log lines iOS: idevicesyslog · Android: adb logcat HAR, over the network request headers, body response proxy
Only network traffic passes the proxy into the HAR. What the OS does on the phone shows up only in the device log.
  • Device log: what the OS and the apps did on the phone. The proxy (the server that relays the phone’s traffic) never sees these steps.
  • HAR (the network log): a file of what went over the network (Record the Phone Traffic, Then Read It).
How iOS routes a web link iOS checks if an installed app claims the domain. If yes, lsd opens the app. If no, the URL loads as a web page. App gets a link https://shop.example/... iOS: does an app claim the domain? swcd checks the cached apple-app-site-association file lsd opens the app the advertised app Web page loads the URL itself App's own traffic direct proof is in the device log HAR shows it Sec-Fetch-Mode: navigate yes no
The choice happens inside iOS, so the proxy sees no request for it. On the "yes" path, the direct proof is in the device log.

A universal link is a normal https URL that iOS opens in an app. The website lists the app in its apple-app-site-association file. The choice happens inside iOS, so the proxy sees no request for it. After the app opens, its own traffic is indirect proof. The direct proof is in the device log. There, two iOS background services leave lines: lsd opens app links, and swcd checks which app owns a domain.

Pick the recorder for each claim

Claim Recorder Yes if
A web page opened HAR Sec-Fetch-Mode: navigate
Only a ping was sent HAR Sec-Fetch-Mode: no-cors
An app opened device log lsd ... opening app link
In-app Safari opened device log SFBrowserServiceViewController

Align the clocks first

A HAR uses UTC. idevicesyslog uses the Mac’s local time zone. In the example, the HAR showed the click ping (the request that reports the tap) at 15:23:12 UTC. The device log showed the app open at 23:23:12 local time (UTC+8). It was the same tap. After the fix, the device log showed (app name replaced, pid = process ID):

23:23:12.842 lsd: pid 4242 opening app link
23:23:12.843 swcd: Found entry { s = applinks, d = shop.example, sa = approved }
23:23:13.101 ShopApp: [NWURLConnection] [START] url:https://api.shop.example/...

On Android, app links are listed in /.well-known/assetlinks.json, and ActivityManager in adb logcat logs the app start.

If the HAR shows nothing, do not decide that nothing happened. Ask the OS.

References


Related: start from the click that counted but opened nothing. See the three ways iOS opens a link. Learn to record the phone traffic and read it. Back to the series overview.

↑↓ navigate ↵ open esc close