以 SwiftUI + WKWebView 打造的原生 iOS 外殼 App,全螢幕載入網頁服務 weather.shan33.dpdns.org,並透過 GitHub Actions 免費 macOS Runner 在雲端自動編譯出 .ipa
- 全螢幕
WKWebView載入網頁,隱藏安全區域(edge-to-edge) - 原生
UIRefreshControl下拉刷新,網頁載入完成後自動收起 - 支援邊緣滑動返回/前進手勢導覽
- App 圖示由
icon.png在 CI 中自動縮放為 1024×1024(sips),免手動處理 NSAppTransportSecurity → AllowsArbitraryLoads:允許載入非 HTTPS 資源- 內建定位權限說明文字(
NSLocationWhenInUseUsageDescription)
.
├── .github/workflows/build_ipa.yml # GitHub Actions 雲端打包流程
├── project.yml # XcodeGen 專案定義(CI 上自動生成 .xcodeproj)
├── icon.png # App 圖示來源檔
└── Weather/
├── App.swift # @main 入口
├── ContentView.swift # 根視圖
├── WebView.swift # WKWebView + 下拉刷新封裝
├── Info.plist # ATS、定位權限、版本資訊
└── Assets.xcassets/
└── AppIcon.appiconset/ # 圖示(實體 png 由 CI 生成)
.github/workflows/build_ipa.yml 的執行流程(macos-latest):
- Checkout 程式碼
sips將icon.png轉為 1024×1024 PNG 放入 AppIcon.appiconsetbrew install xcodegen→xcodegen generate產生Weather.xcodeprojxcodebuildRelease 編譯(iphoneosSDK、arm64、無簽名CODE_SIGNING_ALLOWED=NO).app放入Payload/壓縮成Weather.ipa- 上傳為 Artifact(保留 90 天),可選擇附加到 GitHub Release
| 方式 | 說明 |
|---|---|
Push 到 main |
修改 Weather/**、project.yml、icon.png 或 workflow 本身時自動觸發 |
| 手動觸發 | Actions 分頁 → Build iOS IPA → Run workflow,可勾選「同時建立 GitHub Release」 |
Push tag(v*) |
例如 v1.0.0,自動建立 Release 並附上 .ipa |
- 前往 Releases 分頁
- 點選最新版本
- 下載
Weather-ipa.zip(或是直接下載 Releases 版本內提供的.ipa檔)
本專案產出的是未簽名 .ipa,需透過以下方式安裝:
| 工具 | 平台 | 說明 |
|---|---|---|
| Sideloadly | Windows / macOS | 插 USB + Apple ID 免費簽名,憑證 7 天有效 |
| AltStore | Windows / macOS | 同上,透過 AltServer 可自動續簽 |
| TrollStore | iOS(限特定版本) | 永久簽名,免 Apple ID |
brew install xcodegen
xcodegen generate
open Weather.xcodeproj以 Xcode 開啟後選擇模擬器即可執行(Cmd + R)。
| 想改什麼 | 改哪裡 |
|---|---|
| 載入的網址 | Weather/ContentView.swift 內的 urlString |
| App 顯示名稱 | Weather/Info.plist 的 CFBundleDisplayName |
| 版本號 | project.yml 的 MARKETING_VERSION |
| Bundle ID | project.yml 的 PRODUCT_BUNDLE_IDENTIFIER |
| 圖示 | 直接替換根目錄 icon.png |
- 網頁服務:https://weather.shan33.dpdns.org
- 網頁版原始碼:
Server001儲存庫weather/目錄