You can build and run an iOS app on a real iPhone plugged into a Windows PC, using a Mac that sits somewhere else. We tested it end to end: the iPhone stayed on a Windows laptop, Xcode ran on a remote Mac opened in the browser, and an app with the HomeKit capability was signed, installed and launched on the phone.
The question came from a developer without a Mac. His iPhone is connected to his Windows PC by USB, and he needs Xcode to build an app that uses HomeKit. Simulators were not enough: he has real accessories paired with the app. So we tried his exact workflow on one of our Macs before answering.
What we used
| Part | What it was |
|---|---|
| PC | Windows 10 (22H2) laptop |
| Phone | iPhone 16 Pro Max, connected to the PC by USB |
| Mac | MacBook Air M1 8 GB, opened in the browser through a JustMac session |
| IDE | Xcode with the iOS platform installed |
| USB over network, option A | FlexiHub (paid, cloud relay, 5 free demo sessions) |
| USB over network, option B | USB Network Gate free version + Tailscale |
| Apple Account | A developer account signed in to Xcode only |
The browser session gives you the Mac's screen, keyboard and mouse. It does not pass USB devices from your PC, so the iPhone needs its own path: a USB-over-network tool running on both machines.
Step by step
1. Windows: let the PC see the iPhone
Install Apple Devices from the Microsoft Store. Plug in the iPhone, unlock it and tap Trust. When Windows asks what to do with the device, choose to open it as a device with files.
2. Windows: share the iPhone
Install FlexiHub (or USB Network Gate) and sign in. The iPhone appears in the device list as available for connection. Close Apple Devices, iTunes and Photos first.
3. Mac: install the same tool
Open the Mac in the browser, install the client and sign in to the same account. Approve its system extension in System Settings > Privacy & Security if macOS asks. The Windows PC and its iPhone show up in the list.
4. Mac: connect the iPhone
Click Connect next to the iPhone. Unlock the phone and tap Trust when it asks. The iPhone shows up in Finder under Locations.
5. Xcode: sign in
Xcode > Settings > Accounts > + > Apple Account. Sign in here only, not to iCloud in System Settings.
6. Xcode: set up signing
Pick the team, set your own bundle identifier and let Xcode register the iPhone. If it reports a missing private key, create a new certificate (see below).
7. Xcode: add HomeKit
Select the app target, click + Capability, add HomeKit and fill in its Usage Description.
8. Run
Choose the iPhone as the run destination and press Run. The first run copies the phone's system libraries.
| Run | Time |
|---|---|
| First run (device preparation + install) | 29 min |
| Second run (update over the installed app) | about 1 min |
Gotchas we hit
- "Failed to connect to device". Another app was holding the iPhone on Windows. Closing Apple Devices, iTunes and Photos, unlocking the phone and replugging the cable fixed it.
- Windows AutoPlay matters. Choose to open the iPhone as a device with files when Windows asks.
- Keep the iPhone unlocked. A lock makes it reconnect over USB, and the remote link can drop.
- Missing private key. Xcode said the account already had a development certificate for this machine, but its private key was not in the keychain. Don't revoke it if other Macs use it. Create another one instead: Xcode > Settings > Accounts > Manage Certificates > + > Apple Development. A new certificate keeps the same Team ID.
- Greyed-out + Capability. It only works with the app target selected under TARGETS, not the project.
- Multiplatform template. The new project also targeted macOS and visionOS. Ignore their warnings and don't register the remote Mac as a device.
- HomeKit usage text. Fill in the Usage Description, or the app will crash when it asks for HomeKit access.
- Free demo limits. FlexiHub's demo allows 5 sessions, and failed attempts count.
- Don't share the remote Mac's own devices. On the Mac, FlexiHub and USB Network Gate also list the Mac's own USB devices, such as the JustMac KVM keyboard and the USB LAN adapter. Leave them locked. If you take the KVM, the Mac stops getting your keyboard and mouse. If that happens, open Actions > Restart on the session page to reboot the Mac.
FlexiHub or USB Network Gate
Both worked with the iPhone. The difference is how the two machines find each other.
| FlexiHub | USB Network Gate (free) + Tailscale | |
|---|---|---|
| How it connects | Through the vendor's cloud relay | Directly by IP, over a Tailscale network |
| Network setup | None | Install Tailscale on both machines, same account |
| Cost | Paid subscription after 5 demo sessions | Free; the free version shares 1 device, non-commercial use only |
| Best for | The quickest setup | Personal projects on a budget |
Without Tailscale, USB Network Gate only works when the PC and the Mac are on the same network, or with port forwarding on your router. Our Mac and laptop sat on different subnets, so a direct connection failed until both joined Tailscale.
Clean up when you're done: sign out of Xcode, disconnect the iPhone and remove the USB and Tailscale clients from the remote Mac.
What we did not test
- A free Personal Team. We used a paid developer account. Which capabilities a free account gets is up to Apple.
- Keeping existing app data. We installed a fresh test app. An update with the same bundle identifier and Team ID normally keeps the app's data, but that is iOS behaviour, not something a remote Mac controls. Back up before updating an app with real data.
- Exporting an IPA. It wasn't needed: Xcode installs updates straight to the connected iPhone.
- Latency on slow connections. Our test ran over Tailscale, partly on the same Wi-Fi. Over a slow or distant link, the first device preparation will take longer than 29 minutes.
Bottom line
A Windows PC, a real iPhone and a remote Mac are enough for on-device iOS development, including HomeKit. Expect one long first run, then about a minute per build.
Checklist:
- iPhone trusted on Windows, AutoPlay set to device with files
- Apple Devices, iTunes and Photos closed
- FlexiHub, or USB Network Gate + Tailscale, on both machines
- iPhone visible in Finder on the Mac
- Apple Account signed in to Xcode only
- App target selected before adding capabilities
- iPhone unlocked during the first run
- Clean-up done on the remote Mac
We ran this test on a Mac from JustMac, which gives you a Mac in the browser by the day, week or month.










Top comments (0)