Run and Debug Mac Apps from Xcode
You can now set a breakpoint in Xcode on your Mac and step through your app as it runs inside a macOS virtual machine. Xcode builds the app on your Mac, and VirtualBuddy installs it in the guest and connects the debugger. Your source files stay on your Mac, and you can leave Remote Login and shared folders turned off.
- In the VirtualBuddy library, Control-click the virtual machine and choose “Set Up Xcode Debugging…”.
- Choose your Xcode project or workspace and the app scheme you want to run. Enable Custom LLDB Commands if prompted, then click Create Scheme. If you just enabled Custom LLDB Commands, quit and reopen Xcode.
- In Xcode, select the scheme VirtualBuddy created for this virtual machine, choose My Mac as the destination, and press Command-R. The first run can take longer while VirtualBuddy prepares debugging symbols for the guest’s macOS build.
This integration is experimental and has been tested with Xcode 27.3 and macOS 27 guests. The guest needs a logged-in user, the current VirtualBuddyGuest app running, and either Xcode or Apple’s Command Line Tools installed. On your Mac, developer features are on by default when Xcode is installed. You can change this in VirtualBuddy Settings > Developer.
If your app or one of its extensions needs a provisioning profile, VirtualBuddy checks that the profile covers the virtual machine. You can register the virtual machine with your developer team using its Provisioning UDID, or add an App Store Connect team key to register it from VirtualBuddy. With automatic signing, VirtualBuddy can ask Xcode to refresh the profiles. With manual signing, you can import them yourself. [Xcode debugging and provisioning guide](https://github.com/insidegui/VirtualBuddy/blob/main/README-Developers.md)
Service Tunnels
Service tunnels let apps on your Mac connect to local services in a macOS virtual machine, and apps in the guest connect to local services on your Mac. You can forward TCP ports and Unix sockets even when the virtual machine’s network adapter is turned off. Anything that can be communicated via a TCP server or Unix socket can now work between guests and the host.
In a virtual machine’s settings > Service Tunnels, click Add Service Tunnel and choose where the service runs. For example, choose Host to let an app in the guest connect to a local database on your Mac. To reach a web server running in the guest, choose Guest and enter the port the server uses, such as 3000. Under Access from Host, enter an unused port such as 8080. Save the tunnel and the settings, then open http://127.0.0.1:8080 in Safari on your Mac.
Tunnels require a connected, up-to-date copy of VirtualBuddyGuest. Enabled tunnels start again when it reconnects. You can also request a tunnel from the VirtualBuddyGuest menu bar icon inside the guest. By default, you review each request on your Mac in the VM’s Service Tunnels settings. VirtualBuddy also asks before using saved tunnels you haven’t approved for that VM on your Mac. You can change the security level in VirtualBuddy Settings > Security. [Service tunnels guide](https://github.com/insidegui/VirtualBuddy/blob/main/Documentation/ServiceTunnels.md)
Control VirtualBuddy from the Command Line
The new vbctl tool lets you start and stop virtual machines, change display settings, manage shared folders and service tunnels, and check guest status from Terminal or a script. To turn it on, open VirtualBuddy Settings > Security and click Unlock Settings. Turn on “Allow vbctl to control VirtualBuddy” and click “Install Command-Line Tool…”.
For example, these commands list your virtual machines, start one named “Tahoe,” wait for VirtualBuddyGuest to connect, and switch the guest to Dark Mode.
vbctl list
vbctl start Tahoe --wait-for-guest
vbctl guest appearance Tahoe darkScripts can add --json for machine-readable output. While command-line access is on, any process running under your account can use the tool. Tunnels it requests follow the review level you chose in Security settings. [Command-line reference](https://github.com/insidegui/VirtualBuddy/blob/main/Documentation/CommandLine.md)
Other Changes & Improvements
- The redesigned VirtualBuddyGuest menu bar panel shows whether the guest is connected to your Mac and how many tunnels are awaiting approval. You can open shared folders in the Finder and turn Launch at Login on or off from the same panel.
- The settings window has been redesigned and it now has General, Virtualization, Security, and Developer tabs. The Security tab has settings for deep link control, tunnel review, and command-line access. Unlock it with Touch ID or your password to make changes.
- Administrators can use managed preferences to restrict developer features, command-line access, and which ports or sockets a service tunnels are allowed to use.
- Fixes an issue where clicking a virtual machine in the library grid could select the wrong item.
Full Changelog: [2.3-b1...2.3-b2](2.3-b1...2.3-b2)