Procexp-Mac README

项目的 README,来自 github.com/microsoft/Procexp-Mac。合并为一个 markdown 文件:README.md。

Sysinternals Process Explorer for Mac

Sysinternals Process Explorer for Mac is a native macOS implementation of the core Process Explorer experience. It provides a live process tree, lower-pane module/handle/thread inspection, rich per-process properties, system-wide performance graphs, code-signing inspection, and macOS-specific equivalents for Process Explorer workflows.

The app is built with Swift, SwiftUI, and AppKit, with sampling backed by public macOS APIs such as libproc, sysctl, Mach host statistics, Security.framework, IOKit, Metal, and optional privileged helper support.

Sysinternals Process Explorer for Mac showing process details and system information

Features

Requirements

Install xcodegen if needed:

brew install xcodegen

Build

Generate the Xcode project and build the Debug app:

xcodegen generate
xcodebuild -scheme ProcexpMac -configuration Debug build

The Debug app is written under Xcode DerivedData. On this machine the path is typically:

~/Library/Developer/Xcode/DerivedData/ProcexpMac-czqddcuyalgzfgebjezrhssregtw/Build/Products/Debug/ProcExp\ \(Dev\).app

You can also open the generated project in Xcode:

xcodegen generate
open ProcexpMac.xcodeproj

Run

After a Debug build, launch the app with:

open "$HOME/Library/Developer/Xcode/DerivedData/ProcexpMac-czqddcuyalgzfgebjezrhssregtw/Build/Products/Debug/ProcExp (Dev).app"

If your DerivedData suffix differs, locate the product with:

find ~/Library/Developer/Xcode/DerivedData -path '*/Build/Products/Debug/ProcExp (Dev).app' -print

To relaunch a freshly built app from this workspace:

app="$HOME/Library/Developer/Xcode/DerivedData/ProcexpMac-czqddcuyalgzfgebjezrhssregtw/Build/Products/Debug/ProcExp (Dev).app"
pids=$(pgrep -f "$app/Contents/MacOS/ProcexpMac" || true)
if [[ -n "$pids" ]]; then kill $pids 2>/dev/null || true; fi
open -n "$app"

Bundle identity: development vs. official

Unqualified Xcode and local ad-hoc builds use ProcExp (Dev).app with bundle ID com.sysinternals.procexpmac.dev. Its helper uses the separate launchd and Mach service ID com.sysinternals.procexpmac.dev.helper. The development app, helper approval, preferences, and LaunchServices registration therefore do not replace an installed official copy.

The official identities are reserved for an explicit Developer ID build or the Azure release pipeline: ProcExp.app, com.sysinternals.procexpmac, and com.sysinternals.procexpmac.helper. The build and signing scripts validate the entire tuple before signing or publishing it.

Validate

Run the full Swift package test suite:

swift test

Run the live smoke test:

swift run ProcexpSmoke

Run focused test suites:

swift test --filter ProcexpModelTests
swift test --filter ProcexpNetworkTests
swift test --filter ProcexpSigningTests

TCP/IP Test Fixture

The repository includes a small stateful TCP fixture for testing the TCP/IP tab:

swift build --product ProcexpTcpFixture
.build/debug/ProcexpTcpFixture --duration 3600 --remote-host github.com --remote-port 22

The fixture opens a loopback listener, creates a loopback established connection, and optionally opens a DNS-resolved remote TCP connection. Select the fixture process in Process Explorer and open Properties > TCP/IP to inspect the sockets and remote-name resolution.

Privileged Helper

The app can use an optional privileged root helper for operations that require elevated privileges, such as richer cross-user process detail (full process list, threads, modules, environment) and privileged process control. The helper is a launchd daemon reached over XPC; the app registers it with SMAppService.

macOS gates SMAppService daemon registration on the app's code signature and on an explicit user approval. The app must be signed with a stable, non-ad-hoc identity — a Developer ID Application certificate for distribution, or a self-signed identity for local development — and you approve the daemon once in System Settings ▸ General ▸ Login Items & Extensions. The sections below cover both the Developer ID install and a local self-signed test.

Testing with a Developer ID certificate (real install)

This is the same experience end users get.

DEV_SIGN_IDENTITY="Developer ID Application: NAME (TEAMID)" \
bash Scripts/dev_install_helper.sh

This builds a Release app, embeds the helper and its launchd plist at Contents/Library/LaunchDaemons/, signs everything inside-out with the Hardened Runtime and entitlements, installs /Applications/ProcExp.app, and launches it. Then, in the app, choose ProcexpMac ▸ Install Privileged Helper… and approve the daemon in System Settings ▸ General ▸ Login Items & Extensions. After approval the app adopts the privileged provider and shows all processes.

Testing without a Developer ID certificate (local self-signed)

For local development you can exercise the same privileged code path with a throwaway self-signed identity. On first run the script creates the identity in a dedicated keychain (no login-keychain involvement), builds a signed, helper-embedded app, installs it to /Applications, and launches it:

bash Scripts/dev_install_helper.sh

Then, one time only, choose ProcexpMac ▸ Install Privileged Helper… and approve the daemon in System Settings ▸ General ▸ Login Items & Extensions. After that, every subsequent run of the script rebuilds and relaunches the signed app with the helper already enabled, so the elevated path is available on each iteration:

bash Scripts/dev_install_helper.sh          # Debug (default), fast
CONFIGURATION=Release bash Scripts/dev_install_helper.sh
RESTART_HELPER=1 bash Scripts/dev_install_helper.sh   # after changing helper code

Notes:

Verifying and cleaning up

Check whether the daemon is registered and running as root:

launchctl print system/com.sysinternals.procexpmac.dev.helper

For an explicit Developer ID install, inspect the official service instead:

launchctl print system/com.sysinternals.procexpmac.helper

If registration succeeded, the process list shows previously hidden cross-user and system processes. If the daemon is registered but not yet enabled, approve it in System Settings ▸ General ▸ Login Items & Extensions and it becomes active. Repeated reinstalls can clear a previously remembered approval, in which case macOS asks you to approve it again. If registration is refused outright (for example, an ad-hoc signature), the app reports that the helper could not be registered and continues in unprivileged mode.

Remove the installed app and unregister the helper:

bash Scripts/dev_uninstall_helper.sh

The cleanup script defaults to the development tuple. To remove an explicit Developer ID test install instead, run:

PROCEXP_LOCAL_FLAVOR=official bash Scripts/dev_uninstall_helper.sh

Remove the throwaway signing keychain when finished:

security delete-keychain "$HOME/Library/Keychains/procexp-dev.keychain-db"

See Helper/README.md and docs/RELEASE.md for the helper architecture and the full Developer ID signing/notarization pipeline.

Release Build

Build a release DMG:

bash Scripts/build_release.sh

This local ad-hoc command creates build/ProcExp-Dev.dmg containing ProcExp (Dev).app. To prepare the canonical app for Developer ID signing:

PROCEXP_BUILD_FLAVOR=official PACKAGE_DMG=0 bash Scripts/build_release.sh

Sign and notarize a release build after configuring Developer ID credentials:

bash Scripts/sign_notarize.sh

See docs/RELEASE.md for the full release pipeline.

Project Layout

Notes

macOS does not expose every Process Explorer data source through public APIs. Where macOS denies access or a metric is not available through supported APIs, the UI leaves values blank rather than fabricating data. Some details become available only for same-user processes or when the privileged helper is active.

Procexp-Mac (microsoft/Procexp-Mac)

正在搜索数据库…

这是什么?这是 Sysinternals Process Explorer 的原生 macOS 版本,提供实时进程树、每个进程的属性、系统性能图表以及代码签名检查功能。
这是 Mac 应用还是可以导入的库?这是一个独立的 macOS 图形界面应用,不是库。它使用 Swift、SwiftUI 和 AppKit 构建,需要在自己的 Mac 上运行。
怎么构建和运行?先安装 xcodegen,用 project.yml 生成 ProcexpMac.xcodeproj,然后在 Xcode 中构建 Debug 目标,或在 Xcode 中打开生成的项目。运行 DerivedData 中生成的 ProcExp (Dev).app。
构建之前需要准备什么?macOS 14 或更高版本、Xcode 26.6 或更高版本(推荐)、Swift 5.9 或更新的工具链,以及用于重新生成项目文件的 xcodegen。
它能显示 Windows 版 Process Explorer 的所有信息吗?不能。macOS 并不通过公开 API 提供所有数据源,因此不支持的指标会留空,而不会伪造数据。部分细节只对同一用户的进程显示,或在特权助手运行时才会显示。
Intel 芯片的 Mac 和 Apple Silicon 的 Mac 都能用吗?它面向 macOS 14 及更高版本,并针对 Apple Silicon 做了性能核心和能效核心的专门标注,因此 Apple Silicon 是明确支持的平台。README 中没有明确说明是否支持 Intel 芯片的 Mac。
有没有数据会离开我的 Mac?本地进程采样只在本机进行。“Search Online”和 VirusTotal 检查会把查询发送到外部服务,但只有在你主动选择这些操作时才会发生。
单个进程能查看哪些信息?属性窗口包含 Image、Performance、Performance Graph、Threads、TCP/IP、Security、Environment 和 Strings 标签页。Security 标签页显示签名者、公证状态和 SHA-256。
我能在应用里对进程进行操作吗?可以。你可以结束一个进程或其整个进程树、挂起和恢复进程、设置优先级、重新启动进程、将其置于前台、对其进行采样,以及在 VirusTotal 上检查它。
要看到所有进程,需要管理员权限吗?默认不需要,因为应用以非特权方式运行。对于其他用户和系统进程,你可以安装可选的特权助手,并在“系统设置”的“通用”下的“登录项与扩展”中一次性批准。
菜单栏里有什么?有一个菜单栏 CPU 历史记录项。应用还有原生菜单栏,包含 File、Options、View、Process、Find、Window 和 Help 命令。
作者
microsoft
大小
2.4 MB
星标
997
时长
4个月
提交 · 90 天