Skip to content
WritingArticle
  • #ios
  • #swiftui
  • #windows
  • #debugging

Debug iPhone Apps from Windows: Live Logs, Crash Reports and Network Traffic Without Xcode

Pawan Joshi

7 min read

Share
Cover image for “Debug iPhone Apps from Windows: Live Logs, Crash Reports and Network Traffic Without Xcode”

If you follow Build iOS Apps on Windows Without a Mac, you can build and install real iPhone apps from a Windows PC. The first time your app crashes, you'll miss one thing: Xcode's debugger.

You don't need it. Between the iPhone itself, a few free Windows tools and good logging in your code, you can find almost any bug. Here's the toolkit.

The debugging toolkit at a glance

ProblemToolWorks from Windows?
See what the app prints while runningidevicesyslog (libimobiledevice)Yes
Find out why the app crashedCrash reports on the iPhoneYes, from the phone
Show errors to yourself while testingAn in-app debug screenYes
See API requests and responsesAn HTTPS debugging proxyYes
Catch compile errorsGitHub Actions build logYes

Debugging toolkit map: an iPhone surrounded by live logs, crash reports, a network proxy and build logsFour free sources of truth cover almost every bug: logs, crash reports, network traffic and build logs.

1. Add good logging first

Every other tool works better if your app logs what it's doing. Use Apple's OSLog Logger, which is fast and shows up in the device's system log:

import OSLog
 
extension Logger {
    static let app = Logger(subsystem: "dev.pawanjoshi.HelloPhone", category: "app")
    static let network = Logger(subsystem: "dev.pawanjoshi.HelloPhone", category: "network")
}
 
// Usage
Logger.network.info("Loading notes")
Logger.network.error("Request failed: \(error.localizedDescription, privacy: .public)")

Two tips:

  • Use levels: debug for detail, info for normal events, error for failures.
  • By default, dynamic values are hidden as <private> in logs. Add privacy: .public only for values that aren't personal, like status codes or error messages.

2. See live logs on Windows with idevicesyslog

libimobiledevice is a free, open-source set of tools that talk to iPhones over USB. Its idevicesyslog command streams the phone's system log, including your Logger messages, to your Windows terminal.

  1. Install the Apple USB drivers (iTunes from apple.com or the Apple Devices app), which you already have if you use Sideloadly.
  2. Download a Windows build of libimobiledevice and add its folder to your PATH.
  3. Connect the iPhone, unlock it, and trust the computer.
  4. Run:
idevice_id -l                         # should print your iPhone's ID
idevicesyslog --match HelloPhone      # stream only lines containing your app's name

Now open the app on the phone and watch your log lines appear live. Filter by your subsystem or a word you log, because the full system log is very noisy.

An iPhone connected by USB to a Windows terminal where idevicesyslog streams the app's log lines, including a red error lineWhat idevicesyslog looks like: INFO lines in green and the failing request in red.

3. Read crash reports on the iPhone

When an app crashes, iOS saves a report. You can read it without a Mac:

  1. On the iPhone, open Settings → Privacy & Security → Analytics & Improvements → Analytics Data.
  2. Find a file starting with your app's name and the crash date.
  3. Open it and use the share button to AirDrop or email it to yourself.

What to look for in the report:

  • Exception Type, for example EXC_CRASH (SIGABRT) or EXC_BAD_ACCESS.
  • Termination Reason, which often states the cause directly, for example a missing privacy description.
  • The crashed thread's backtrace. Look for lines with your app's name. Without symbols you'll see addresses instead of function names, but the reason fields usually tell you enough.

4. The most common crashes and their fixes

What you seeLikely causeFix
App closes instantly when opening camera or micMissing usage descriptionAdd NSCameraUsageDescription, NSMicrophoneUsageDescription and similar to Info.plist
Fatal error: Unexpectedly found nilForce-unwrapping a nil value with !Use if let, guard let or ??
Index out of rangeReading an array position that doesn't existCheck indices.contains(i) or use first and last
Crash after a network callUpdating UI from a background thread or decoding unexpected JSONMark UI models @MainActor; make decoding errors throw and handle them
App won't open at all after a weekFree signing certificate expiredRe-sign and install with Sideloadly

5. Build an in-app debug screen

When you test on your own phone, the fastest debugger is one inside the app. Keep the last few errors in memory and show them on a hidden screen:

import SwiftUI
 
@Observable
final class DebugLog {
    static let shared = DebugLog()
    private(set) var entries: [String] = []
 
    func add(_ message: String) {
        let time = Date.now.formatted(date: .omitted, time: .standard)
        entries.insert("\(time)  \(message)", at: 0)
        if entries.count > 100 { entries.removeLast() }
    }
}
 
struct DebugView: View {
    let log = DebugLog.shared
    var body: some View {
        List(log.entries, id: \.self) { Text($0).font(.caption.monospaced()) }
            .navigationTitle("Debug log")
    }
}

Open it with a long-press on your app's title, and wrap it in #if DEBUG so it never ships in a release build.

6. Inspect network calls with a proxy

Many bugs are really API problems: a wrong URL, a missing header, a 401. A debugging proxy on Windows shows every request your iPhone makes.

Tools like mitmproxy (free and open source), Fiddler or Proxyman run on Windows. The setup is similar for all of them:

  1. Start the proxy on your PC and note its port, for example 8080.
  2. Make sure the iPhone and PC are on the same Wi-Fi.
  3. On the iPhone: Settings → Wi-Fi → (i) next to your network → Configure Proxy → Manual, then enter your PC's IP address and the port.
  4. Install the proxy's certificate on the iPhone from the address the tool gives you, then enable it in Settings → General → About → Certificate Trust Settings.
  5. Open your app and watch the requests and responses appear.

When you're done, turn the proxy off and remove the certificate from the phone. Only do this on your own device and your own apps.

Proxy debugging: the iPhone sends requests through a proxy on the Windows PC, which forwards them to the API and shows the repliesThe proxy sits in the middle, so you can read every request and reply.

7. Read build errors in GitHub Actions

Compile errors show up in the workflow log, not on the phone. In the failed step, search for error:. Each error names the file and line:

/Users/runner/work/HelloPhone/HelloPhone/ContentView.swift:14:22: error: cannot find 'tap' in scope

Keep changes small and push often, so each failed build points to one recent change.

A simple debugging routine

  1. Reproduce it. Write down the exact steps that cause the bug.
  2. Watch the logs with idevicesyslog while you repeat the steps.
  3. If it crashes, read the crash report's termination reason.
  4. If it's data, check the network calls in the proxy.
  5. Fix, push, rebuild, reinstall, and confirm the steps no longer cause the bug.

Key takeaways

  • Add Logger calls first. Every other tool works better with good logs.
  • idevicesyslog streams your logs to Windows, and the crash report's Termination Reason usually names the cause.
  • A proxy shows API problems that logs can't, such as a wrong URL or missing header.

Next, connect your app to a real backend in Call a Serverless API from SwiftUI with async/await.

Found this useful?

Share it with your group