docs(ios): 同步 0.2.x 实况文档与规划记录

This commit is contained in:
chick
2026-09-14 18:22:23 +08:00
parent 3607eddc9f
commit ec3ffb9db3
9 changed files with 339 additions and 60 deletions
-26
View File
@@ -1,26 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="1024" height="1024" viewBox="0 0 1024 1024">
<defs>
<linearGradient id="gold" x1="0.18" y1="0.04" x2="0.82" y2="0.96">
<stop offset="0" stop-color="#FFE9B0"/>
<stop offset="0.24" stop-color="#F4C767"/>
<stop offset="0.68" stop-color="#DA9F45"/>
<stop offset="1" stop-color="#B77B2D"/>
</linearGradient>
<linearGradient id="sheen" x1="0.18" y1="0" x2="0.82" y2="0.88">
<stop offset="0" stop-color="#FFFFFF" stop-opacity="0.24"/>
<stop offset="0.52" stop-color="#FFFFFF" stop-opacity="0.04"/>
<stop offset="1" stop-color="#FFFFFF" stop-opacity="0"/>
</linearGradient>
<linearGradient id="bar" x1="0" y1="0" x2="0" y2="1">
<stop offset="0" stop-color="#2A2F37"/>
<stop offset="1" stop-color="#111419"/>
</linearGradient>
</defs>
<rect width="1024" height="1024" fill="url(#gold)"/>
<rect width="1024" height="1024" fill="url(#sheen)"/>
<g fill="url(#bar)">
<rect x="317" y="602" width="108" height="188" rx="54"/>
<rect x="458" y="475" width="108" height="315" rx="54"/>
<rect x="599" y="348" width="108" height="442" rx="54"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1.2 KiB

+53
View File
@@ -0,0 +1,53 @@
# MultiSimAdmin iOS
iPhone 原生应用的 Swift Package。产品与技术说明见 [docs/ios-native.md](../../docs/ios-native.md),
本文件只写这个目录里怎么动手。
## 目录
```text
Sources/MultiSimAdmin/
AppMetadata.swift 版本号与 Bundle ID 的唯一来源
MultiSimAdminApp.swift 入口、三个底部 Tab、调试直达参数
Models/ 实例、分组、查询等值类型
Features/{Fleet,Device,Messages,Logs,Settings}/ 页面与 view model
Upstream/ 路由白名单、HTTP 客户端、按实例隔离的会话 Cookie
Services/ 连接探测、凭据存储、依赖装配
Persistence/ 沙盒 JSON 文件仓储与日志存储
Theme/ 颜色令牌、按钮与卡片样式、骨架、主题模式
Support/ 错误文案、时间显示、调试启动
Resources/ Info.plist、Assets.xcassets
Tests/MultiSimAdminTests/ 48 个用例
Design/ 图标生成脚本与参考稿
```
## 常用命令
```bash
swift build
swift test
xcodebuild -scheme MultiSimAdmin \
-destination 'platform=iOS Simulator,id=<UDID>' \
-configuration Debug build
swift Design/generate_app_icon.swift \
Sources/MultiSimAdmin/Resources/Assets.xcassets/AppIcon.appiconset/AppIcon1024.png
```
未签名 IPA 从仓库根目录执行 `./scripts/build-ios-ipa.sh` 生成。
## 发版要改的地方
版本号必须四处一致,否则测试会失败:
1. `Sources/MultiSimAdmin/Resources/Info.plist` 的 `CFBundleShortVersionString` 与 `CFBundleVersion`
2. `Sources/MultiSimAdmin/AppMetadata.swift`
3. `Tests/MultiSimAdminTests/AppMetadataTests.swift`
4. `Tests/MultiSimAdminTests/SettingsViewModelTests.swift`
改完补一份 `docs/ios-native-<version>.md` 发布说明,并同步更新 `docs/ios-native.md`、仓库根
README 的版本引用。
## 界面约定
主操作只用一种蓝色,危险操作只用红色;同屏并排控件等高;选中态不得改变控件尺寸;标签统一
28pt 胶囊;卡片内部不再嵌套卡片;不得出现因配色而在深色背景上消失的按钮或文字。