The short answer
Short answer: a Capacitor app runs inside a WebView, so most problems can be sorted out in a browser on Windows and on Android. The iOS simulator requires a Mac. Live reload on a physical device needs the phone and the computer on the same Wi-Fi, which a remote Mac cannot offer.
Which steps require macOS
What does not need a Mac
- Pure web logic such as page layout, routing and API calls: debug it with a local development server and a browser.
- The Android implementation of plugins: verify it on an Android device or emulator.
What needs a Mac
- The iOS simulator.
npx cap run iosbuilds the native project and deploys it to the target device you choose, which uses Xcode. - Problems that only show up in the iOS WebView. On iOS Capacitor uses WKWebView, whose styling and behavior differ from Chrome-family browsers. Issues around safe areas, the keyboard appearing and scroll bounce can only be reproduced on iOS.
- The native iOS behavior of plugins and permission prompts.
What a remote Mac cannot do
- Connect to the iPhone in your hand. Capacitor's live reload docs state that when running on a physical device, the device has to be on the same Wi-Fi network as the computer. Your phone and the remote Mac are not on the same network, and customers are not allowed to change the machine's network configuration, so do not count on this route.
How to do it on a remote Mac
List the available simulators
In the project directory on the remote Mac, run:
npx cap run ios --listIt prints the target devices available for the platform. If the list is empty, open Xcode and install a simulator runtime first.
Deploy to a specific simulator
npx cap run ios --target DEVICE_IDYou can also select by name:
--target-namefollowed by the device name. When several OS versions exist for the same device name, add--target-name-sdk-versionto tell them apart. Per the docs, run performs a sync first and then builds and deploys. If you have just synced, add--no-syncto skip it.Turn on live reload in the simulator
Start the front-end development server on the remote Mac first, then:
npx cap run ios --live-reload --port PORT--live-reloadoverridesserver.urlin the config with the address given on the command line. Use--hostto specify the host when needed. The development server and the simulator are on the same Mac, so no network changes are involved. After you change code the WebView refreshes by itself, and you do not need to rebuild the native package each time.If you write
server.urlintocapacitor.configby hand, the docs remind you to bind the development server to0.0.0.0and not to commit that piece of configuration to version control.Debug the front-end code inside the WebView
Pages in the simulator can be inspected with Safari's Web Inspector on the Mac, which shows the console, network requests and elements. How to enable it varies with the Safari and macOS version, so follow Apple's documentation and the Capacitor docs. Native-layer logs are in Xcode's console: open the project with
npx cap open iosand run it from Xcode.Verify on a real device through TestFlight
Upload the build following the steps in building a Capacitor ipa and install it from TestFlight on your own phone. Before building, confirm
server.urlis not left in the config. There are no breakpoints; you locate problems through logs and crash reports. The reason is in can a remote Mac debug on a real device.
FAQ
I write code on Windows. How do I get the simulator on the remote Mac to refresh?
Push the changes to Git and pull them on the remote Mac. When the development server detects the file changes, the WebView in the simulator refreshes. You can also edit on the remote Mac itself. Do not install tunneling or proxy tools to make your local development server reachable from the remote Mac. The machine's network configuration may not be changed.
Can the simulator test push notifications, the camera and Bluetooth?
The simulator does not fully cover features like these that depend on hardware or system services. They have to be verified on a real device. If your app relies heavily on them and you need step-by-step breakpoints, a remote Mac is not the right solution. You need a Mac within arm's reach.
Styling on iOS differs from Android. What do I check first?
First confirm the problem only appears in the iOS WebView: reproduce it in the simulator and look at the applied styles with Web Inspector. Padding related to safe areas and layout changes when the keyboard appears are the two most common sources of difference between the platforms.
Will dragging the simulator around be laggy over remote desktop?
Smoothness depends on your local network connection. We do not give delay figures. We suggest writing code locally and switching to the remote desktop only when you need to see the iOS result. See is Xcode laggy on a remote Mac.
Related
- How do I build an iOS ipa for a Capacitor or Ionic app without a Mac?
- How do I set up iOS certificates and signing for Capacitor without a Mac?
- Can I debug on a real iPhone with a remote Mac?
- Is Xcode laggy on a remote Mac?
Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support