Skip to main content
On this page

Connect an iPhone to Windows, WSL or Linux for Debugging

Get your computer to recognize your iPhone. Install the driver, trust the computer and turn on Developer Mode, download device symbols before your first debug session, and choose between multiple devices.

Last updated

To connect an iPhone to Windows for debugging, do three things: install and open Apple Devices from the Microsoft Store so the driver gets installed, unlock the iPhone and tap Trust This Computer, then turn on Developer Mode in Settings. After that, the iPhone shows up under the device node in the KXBuild view, ready to install, run and debug with breakpoints. WSL uses the Windows driver, Linux needs usbmuxd, and macOS needs no setup.

Which driver do I need to connect an iPhone to Windows?

If your computer doesn't have the Apple device drivers, the device node in the KXBuild view says "click to set up". Click it. On the command line, run kxdevice doctor.

> kxdevice doctor
OSWhat happens
WindowsStarts the Apple device service, which needs one administrator approval. Install Apple Devices from the Microsoft Store and open it first so the driver gets installed.
WSLThe driver lives on the Windows side. Plug the iPhone into Windows and WSL can use it directly. Don't pass the iPhone through to WSL with usbipd.
LinuxInstalls and starts usbmuxd, which needs sudo
macOSNothing to do

What do I set up on the iPhone for on-device debugging?

1. Trust This Computer

The first time you connect, the iPhone asks whether to trust this computer. Unlock it and tap Trust. The prompt doesn't appear if you're using a charge-only cable or the iPhone is locked. If you tapped Don't Trust before, go to Settings > General > Transfer or Reset iPhone > Reset > Reset Location & Privacy, then unplug and reconnect.

2. Turn on Developer Mode

Go to Settings > Privacy & Security > Developer Mode, turn it on and let the iPhone restart. The switch only appears after the iPhone has been connected to a computer.

3. Wait for device symbols

The first time you debug on a given iOS version, KXBuild downloads its device symbols. It's a few GB and takes about ten minutes, but only once. Progress shows in a notification, and an interrupted download resumes next time.

How do I choose which iPhone to debug on?

When your iPhone appears under the device node in the KXBuild view, click it to make it the active device. You can also switch from the Status Bar. On the command line, run kxdevice device list. The first column is the UDID. With several devices, pass --udid to choose one. Otherwise the first is used.

> kxdevice device list

The same iPhone may appear twice, once over USB and once over Wi-Fi. USB is more reliable for installing and debugging. If the list is empty, try another cable or USB port, and unlock the iPhone to check for a prompt. If Apple Devices can see the iPhone, so can KXBuild.

Once the device node lists your phone, you're ready to connect an iPhone to Windows for debugging. Press F5 to build, sign, install and start the debugger, as described in debug iOS apps on iPhone in VS Code. If you haven't added a certificate yet, see sign iOS apps on Windows first.

Next steps