From 7ea40d98e666a47e3b3e9fec9e5d7a61dbc15c6b Mon Sep 17 00:00:00 2001 From: gentpan Date: Sun, 13 Sep 2026 03:05:02 +0500 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20make=20install=EF=BC=9ARel?= =?UTF-8?q?ease=20=E6=9E=84=E5=BB=BA=E5=B9=B6=E5=AE=89=E8=A3=85=E5=88=B0?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E7=A8=8B=E5=BA=8F=E6=96=87=E4=BB=B6=E5=A4=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Makefile | 11 ++++++++++- README.md | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 15b8fcc..362d8a5 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CONFIG ?= Debug DERIVED := build/DerivedData APP := $(DERIVED)/Build/Products/$(CONFIG)/OpenStats.app -.PHONY: generate build run stop test snapshot open clean +.PHONY: generate build run install stop test snapshot open clean ## 由 project.yml 生成 Xcode 工程 generate: @@ -19,6 +19,15 @@ build: generate run: build stop open $(APP) +## 以 Release 构建安装到 /Applications 并启动(覆盖旧版本,保留偏好设置) +install: + $(MAKE) build CONFIG=Release + -pkill -x OpenStats + rm -rf /Applications/OpenStats.app + ditto $(DERIVED)/Build/Products/Release/OpenStats.app /Applications/OpenStats.app + /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /Applications/OpenStats.app + open /Applications/OpenStats.app + stop: -pkill -x OpenStats diff --git a/README.md b/README.md index b945b60..bfe2fe5 100644 --- a/README.md +++ b/README.md @@ -119,6 +119,7 @@ brew install xcodegen make run # 生成工程、编译并启动(Debug) make run CONFIG=Release # Release 构建 +make install # Release 构建并安装到 /Applications 后启动 make test # 单元测试 make snapshot # 用本机实时数据渲染各页面截图到 build/snapshots make open # 生成并用 Xcode 打开工程