---
title: "【开源自荐】devcheck：macOS 菜单栏端口地图，看清 3000 端口被谁占了 - Angryecho"
description: "项目地址：https://github.com/iihao/devcheck 一句话：Mac 菜单栏端口地图，告诉你每个端口被谁占用、属于哪个代码项目、以及该怎么处理。"
canonical_url: "https://www.angryecho.com/c/ruan_yi_feng/p/P2TBC3sI9GjA2haYdi48H"
meta:
  "og:description": "项目地址：https://github.com/iihao/devcheck 一句话：Mac 菜单栏端口地图，告诉你每个端口被谁占用、属于哪个代码项目、以及该怎么处理。"
  "og:image": "https://www.angryecho.com/_og/d/c_Post%2Ctitle_~5ZCQ5qe9572R%2Cdescription_~5ZCQ5qe95LiA5LiL77yM5bCx5LiK5ZCQ5qe9572R44CC%2CpostId_P2TBC3sI9GjA2haYdi48H%2Crevision_~MjAyNi0xMS0wM1QwNToyOTowOS44NzY2NTVa%2Cp_Ii9jL3J1YW5feWlfZmVuZy9wL1AyVEJDM3NJOUdqQTJoYVlkaTQ4SCI%2Cs_VK9tDQKkQTCl3qOm.png"
  "og:image:height": "630"
  "og:image:type": image/png
  "og:image:width": "1200"
  "og:title": "【开源自荐】devcheck：macOS 菜单栏端口地图，看清 3000 端口被谁占了"
---

> Index of every page on this site: [llms.txt](https://www.angryecho.com/llms.txt)

# **【开源自荐】devcheck：macOS 菜单栏端口地图，看清 3000 端口被谁占了**

项目地址： https://github.com/iihao/devcheck

**一句话**：Mac 菜单栏端口地图，告诉你每个端口被谁占用、属于哪个代码项目、以及该怎么处理。

**两个真实痛点**：

1. `npm run dev` 报 EADDRINUSE， `lsof -i :3000` 只给一个 PID，不知道是哪个项目留下的旧进程；
2. 5000 端口被 macOS 自己的「隔空播放接收器」（ControlCenter）占着，服务能起来但静默失败，排查很久。

而且 `lsof` 会把二十多个桌面应用和系统守护进程一起列出来，噪音太大。

**做法**：

- 端口 → 进程 → **所属项目**（从进程 cwd 向上找 `package.json` / `pom.xml` / `go.mod` / `.git`）
- 默认隐藏 GUI 应用/系统端口，只留跟开发相关的
- `devcheck why 5000` 用人话解释，并给处理建议（去系统设置关掉 AirPlay，或换 5001）
- 体检规则：同一端口被多进程占用、端口在监听但握手失败（假活）、单进程 CPU 飙高

**几个刻意的技术选择**：

- 可达性用裸 TCP 握手（ `connect` + `poll`）判断，不用 HTTP——否则 Redis/MySQL 会被误判成挂了
- 零第三方依赖、零特权：不装任何库，不需要 sudo 或「完全磁盘访问」，没有任何网络请求和埋点
- 体检规则是纯函数，30 个单测；菜单栏用 AppKit，通用二进制（arm64 + x86\_64）

**安装**：

```
brew install --cask iihao/tap/devcheck
```

（会同时装菜单栏 App 和 `devcheck` 命令行。构建暂无 Apple Developer 签名，首次启动需要 `xattr -dr com.apple.quarantine /Applications/DevCheck.app`）

截图： https://raw.githubusercontent.com/iihao/devcheck/main/docs/menubar.png CLI 演示： https://raw.githubusercontent.com/iihao/devcheck/main/docs/demo-cli.zh.gif

排序方式 :

### **成为第一条评论！**

Nobody's responded to this post yet. Add your thoughts and get the conversation going.

```json
{"@context":"https://schema.org","@graph":[{"@id":"https://www.angryecho.com/c/ruan_yi_feng/p/P2TBC3sI9GjA2haYdi48H#post","@type":"DiscussionForumPosting","commentCount":0,"dateModified":"2026-11-03T05:29:09.876Z","datePublished":"2026-11-03T03:49:29.000Z","description":"项目地址：https://github.com/iihao/devcheck 一句话：Mac 菜单栏端口地图，告诉你每个端口被谁占用、属于哪个代码项目、以及该怎么处理。","headline":"【开源自荐】devcheck：macOS 菜单栏端口地图，看清 3000 端口被谁占了","isPartOf":"https://www.angryecho.com/c/ruan_yi_feng","mainEntityOfPage":"https://www.angryecho.com/c/ruan_yi_feng/p/P2TBC3sI9GjA2haYdi48H","text":"项目地址：https://github.com/iihao/devcheck\n\n一句话：Mac 菜单栏端口地图，告诉你每个端口被谁占用、属于哪个代码项目、以及该怎么处理。\n\n两个真实痛点：\n\n\n\n\n\nnpm run dev 报 EADDRINUSE，lsof -i :3000 只给一个 PID，不知道是哪个项目留下的旧进程；\n\n\n\n5000 端口被 macOS 自己的「隔空播放接收器」（ControlCenter）占着，服务能起来但静默失败，排查很久。\n\n而且 lsof 会把二十多个桌面应用和系统守护进程一起列出来，噪音太大。\n\n做法：\n\n\n\n\n\n端口 → 进程 → 所属项目（从进程 cwd 向上找 package.json / pom.xml / go.mod / .git）\n\n\n\n默认隐藏 GUI 应用/系统端口，只留跟开发相关的\n\n\n\ndevcheck why 5000 用人话解释，并给处理建议（去系统设置关掉 AirPlay，或换 5001）\n\n\n\n体检规则：同一端口被多进程占用、端口在监听但握手失败（假活）、单进程 CPU 飙高\n\n几个刻意的技术选择：\n\n\n\n\n\n可达性用裸 TCP 握手（connect + poll）判断，不用 HTTP——否则 Redis/MySQL 会被误判成挂了\n\n\n\n零第三方依赖、零特权：不装任何库，不需要 sudo 或「完全磁盘访问」，没有任何网络请求和埋点\n\n\n\n体检规则是纯函数，30 个单测；菜单栏用 AppKit，通用二进制（arm64 + x86_64）\n\n安装：\n\nbrew install --cask iihao/tap/devcheck\n\n（会同时装菜单栏 App 和 devcheck 命令行。构建暂无 Apple Developer 签名，首次启动需要 xattr -dr com.apple.quarantine /Applications/DevCheck.app）\n\n截图：https://raw.githubusercontent.com/iihao/devcheck/main/docs/menubar.png\nCLI 演示：https://raw.githubusercontent.com/iihao/devcheck/main/docs/demo-cli.zh.gif","url":"https://www.angryecho.com/c/ruan_yi_feng/p/P2TBC3sI9GjA2haYdi48H","author":{"@type":"Person","name":"iihao","url":"https://www.angryecho.com/u/RYW29720840"},"interactionStatistic":[{"@type":"InteractionCounter","interactionType":"https://schema.org/LikeAction","userInteractionCount":0},{"@type":"InteractionCounter","interactionType":"https://schema.org/DislikeAction","userInteractionCount":0},{"@type":"InteractionCounter","interactionType":"https://schema.org/ViewAction","userInteractionCount":0},{"@type":"InteractionCounter","interactionType":"https://schema.org/ShareAction","userInteractionCount":0}]}]}
```

## Sitemap

See the full [sitemap](https://www.angryecho.com/sitemap.md) for all pages.
