dsh-xcodebuild: Xcode Build and Debugging Plugin for DeepSeek Harness

DeepSeek Harness’s plugin-based architecture allows developers to manage local environments through tool links. For iOS/macOS developers, executing xcodebuild directly within an agent workflow is often not intuitive and may lose context. The dsh-xcodebuild plugin connects Xcode’s build, test, debugging, and log streaming to DeepSeek Harness’s conversation flow via a set of model-friendly tools.

Plugin Positioning

This is a DeepSeek Harness client plugin running on macOS, focusing on the build and development loop for iOS and macOS projects. It is maintained by harde1 and licensed under the MIT license. Core plugin features include build, test, clean, archive, run, and real-time filterable build log streaming.

Core Features

The plugin provides the following seven tools for agent invocation:

  • xcode_doctor: Checks the machine environment status, lists missing tools and provides installation commands, and displays the Xcode version currently in use. This tool should be run first when a device cannot be installed to or launched on.
  • xcode_project: Automatically detects the project (.xcworkspace, .xcodeproj, Package.swift) and lists all schemes, configurations, and targets.
  • xcode_destinations: Merges multiple data sources (-showdestinations, xcdevice, devicectl, etc.) and lists all available device destinations, including simulators, My Mac, hardware devices, and USB devices. Each entry includes the available destination string and recommended device.
  • xcode_run: Executes build, test, clean, archive, and run operations. It streams the full log output to a background run and collects compilation errors. It uses simctl for simulators, devicectl for devices known to CoreDevice, and ideviceinstaller + ios-deploy for iOS 16 and earlier.
  • xcode_log: Views run logs. Supports buffered tail, incremental slicing by line number, or regular expression filtering. Calling this tool during a build is safe.
  • xcode_lldb: Debugs the application. Supports viewing the view hierarchy (generating a .lookin file for Lookin.app), running raw LLDB commands (such as po, bt), and managing LLDB sessions (attach, interrupt, detach, status). For iOS 16 and earlier, connection must be made through the debugserver port forwarded by pymobiledevice3.
  • xcode_device_log: Reads logs from a simulator or physical hardware. For iOS 16 and earlier, it can read log files in the crash log directory within the app sandbox.

Typical Usage

In an agent workflow, you can complete a standard development loop using the following steps:

  1. Environment diagnosis: First call xcode_doctor to ensure the machine has Xcode and related dependencies installed.
  2. Project detection: Call xcode_project to get the project structure, schemes, and targets in the current working directory.
  3. Device selection: Call xcode_destinations to list available devices and select the target for the build.
  4. Run the build: Call xcode_run to execute build, test, or run. This operation triggers automatic opening of the sidebar panel and log streaming.
  5. Log inspection: Call xcode_log to view build output in real time, or call xcode_device_log to view device logs.
  6. Debugging and fixing: If you encounter a crash or specific issue, call xcode_lldb to debug, or modify the code directly and repeat steps 3-5.

Interaction and Panel

The plugin displays build status and logs through a panel. By default, the panel opens automatically (controlled by the dsh-xcodebuild:autoOpen key in localStorage).

  • Sidebar integration: If dsh-better-sidebar is installed, the panel is integrated as a tab in the right sidebar; otherwise, it appears as a tab in the native Shell right sidebar, or as a floating window when no sidebar is present.
  • Automatic opening for AI calls: The panel automatically focuses during operations such as build and run. AI calls (such as viewing logs or LLDB operations) do not take over the screen, but are recorded in the AI strip of the panel.

Notes

  • System limitation: The plugin supports macOS only.
  • Dependencies: To use xcode_lldb for debugging iOS 16+ devices, pymobiledevice3 must be installed.
  • License: The plugin code is open source under the MIT license. Review the source code before use to ensure it meets project requirements.

Summary

dsh-xcodebuild provides DeepSeek Harness with a complete closed-loop Xcode development capability. By standardizing tools for build, test, logs, and debugging, developers can let the agent directly handle everyday iOS/macOS development tasks and reduce manual operations.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye