iT邦幫忙

2026 iThome 鐵人賽

DAY 19
0
Build on Google AI

將考國際證照的應用程式變成開源系列 第 29

deployment: environment-setup

  • 分享至 

  • xImage
  •  

01-environment-setup.md

環境設置 (Environment Setup)

AI Agent Target: Contains configuration for local development environment, OS dependencies, SDK versions, and initialization workflows.
Human Target: 建立本地開發環境的逐步指南,包含作業系統相依性與 SDK 版本。

作業系統與前置作業

建議的開發環境為 Windows 11 Pro(主要)、macOS 或 Linux。此處的指南主要針對 Windows。

  • Flutter SDK: 安裝 Flutter 並將其加入 PATH。
  • Dart SDK: 需要 >=3.0.0 <4.0.0 (隨附於 Flutter)。
  • 開發環境 (IDE): 具備 Android SDK 的 Android Studio,或具備 Flutter 擴充套件的 VS Code。
  • 版本控制: Git

初次複製設定 (First Clone Setup)

  1. 複製儲存庫 (Clone the Repository):

    git clone <repository_url>
    cd <project_directory>
    
  2. 下載相依性 (Fetch Dependencies):

    flutter pub get
    
  3. 設定機密資料 (Secrets Setup):
    從範本建立 secrets.json,並填寫所需的 API 金鑰。

  4. 憑證檔案 (Credential Files):
    請確保以下檔案已複製到本地:

    • android/key.properties
    • android/local.properties
    • scripts/service-account.json
  5. Firebase CLI 設定:

    npm install -g firebase-tools
    firebase login
    
  6. Supabase CLI 設定:

    npm install -g supabase
    supabase login
    

工作區策略 (Workspace Strategy)

針對多分支開發,建議使用 Git 工作區 (Git worktrees):

git worktree add ../mockexam-feature-branch feature-branch

如此可避免切換分支時重複編譯原生程式碼。


上一篇
api-integration : admob-setup , crashlytics-shake-setup , ai-api-setup
下一篇
deployment: build-configuration.md
系列文
將考國際證照的應用程式變成開源30
圖片
  熱門推薦
圖片
{{ item.channelVendor }} | {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言