--dry-run; hãy bắt đầu bằng các lệnh chỉ đọc như appship status.
Setup bằng AI agent
Dán một trong các prompt dưới đây vào Claude Code, Codex, Antigravity, Cursor hoặc AI coding agent bất kỳ đang mở ở thư mục gốc của dự án. Agent sẽ cài và cấu hình appship, rồi dừng lại hỏi bạn ở mọi bước cần bạn quyết định. appship không gọi AI nào: prompt chỉ là văn bản, và agent chạy bằng tài khoản của bạn.
- Agent không ghi gì lên store khi bạn chưa yêu cầu, và luôn chạy
--dry-runtrước. Agent chỉ thêm--yessau khi bạn đã duyệt kết quả dry run, vì terminal của agent không trả lời được câu hỏi xác nhận của appship. - Agent không mở, in hay commit file key. Bạn tự thêm key bằng
appship credentials add. - Agent không tự commit hay push. Bạn vẫn nên đọc từng lệnh trước khi cho phép.
Prompt viết bằng tiếng Anh để agent nào cũng hiểu như nhau. Agent sẽ trả lời bằng ngôn ngữ bạn dùng.
Setup dự án
Một lần cho mỗi dự án, kể cả khi máy chưa cài fastlane hay appship. Prompt này làm các bước 2 đến 6 của hướng dẫn; việc tạo key store vẫn do bạn làm.
Set up appship-ai in this project so I can release it to the App Store and Google Play.
appship is a CLI that wraps fastlane. Guide: https://appship.ketchsoft.com/docs.html
1. Check node (22+), fastlane and appship (`appship --version`). Tell me what is missing and ask before installing anything globally (`brew install fastlane`, `npm i -g appship-ai`).
2. Run `appship init --yes --agents <you>` at the project root, where <you> is claude, codex or antigravity (the agent you are; use claude if none fits). Compare release/release.yml with the project (build_command, artifact paths, bundle id, package name), fix what is wrong and tell me what you changed.
3. Store keys: tell me what I need (App Store Connect API key, Google Play service account JSON) and how to create them, following "Get store keys" in the guide. I will run `appship credentials add <profile>` in my own terminal. Then set credentials.profile in release.yml.
4. Fill the store content with the skills that init installed: app-content for release/questionnaire.yml, the listing text in release/*/metadata, then store-screenshots. If the skills are not loaded in this session, read their SKILL.md files in .claude/skills/ or .agents/skills/ and follow them. If the app is already live, ask me whether to run `appship metadata pull` first. Ask me for anything the code cannot tell you; leave contacts, demo accounts and passwords as TODO until I give them.
5. Run `appship doctor` and fix until there is no ✗. List the remaining warnings (!).
6. Finish with a short summary: what is done, what I still have to do by hand, and the next command to run.
Rules:
- Never run a command that writes to a store (upload, metadata push, submit, promote, first-release, signing import, header) unless I ask. Then run it with --dry-run first and wait for my OK. Add --yes only after I approved the dry run in this chat.
- Never open, print, copy or commit key files (*.p8, *.p12, *.jks, *.keystore, service account JSON) or anything in release/keys/.
- Do not commit or push.
- Reply in the language I write in.
Setup CI (GitHub Actions)
Khi dự án đã có release/release.yml. Agent chỉnh workflow ở mục Chạy trong CI cho hợp với dự án và liệt kê các secret cần thêm.
Set up GitHub Actions to release this project with appship-ai. The project already has release/release.yml.
Guide: https://appship.ketchsoft.com/docs.html#ci
1. Start from https://raw.githubusercontent.com/ketchstudio/appship-ai/main/examples/github-actions.yml. Save it as .github/workflows/release.yml and adapt it to this project: platforms, toolchain setup, build steps, Android keystore, and the iOS signing method in use (fastlane match, files from the account owner with `appship signing import --keychain`, or automatic signing).
2. Keep `appship doctor` as the first appship step. Store-writing steps need --yes in CI; keep submit behind the manual `submit` input.
3. List every secret I must add in Settings → Secrets and variables → Actions, with the command that produces each value (for example `base64 -i AuthKey_XXXX.p8 | pbcopy`). I add the secrets myself. Never read or print key files and never write a key value into a file.
4. Creating the iOS app and uploading App Privacy need an Apple ID with 2FA and cannot run in CI. If this project still needs them, tell me to run them locally once.
5. Show me the final workflow and the list of secrets. Do not commit or push until I say so.
Reply in the language I write in.
Mỗi lần release
Tăng version, viết release notes cho mọi ngôn ngữ, chạy thử upload bằng dry run rồi dừng lại chờ bạn đồng ý.
Prepare a new release of this project with appship-ai (already set up in release/).
1. Find the current version and build number (pubspec.yaml, build.gradle, the Xcode project or Info.plist, package.json: whatever this project uses) and read the git log since the last tag. Propose the next version and build number, and change them once I agree.
2. Write the release notes for every locale with the release-notes skill (read its SKILL.md in .claude/skills/ or .agents/skills/ if it is not loaded).
3. Run `appship doctor` and fix the errors.
4. Run `appship upload --build --dry-run`, show me what would be sent, and stop.
When I approve, run `appship upload --build`. When I later ask to submit, run `appship submit --dry-run` first and wait for my OK again. Add --yes only after I approved the dry run in this chat. Never open or print key files. Do not commit or push unless I ask.
Reply in the language I write in.
Ký app iOS khi không phải chủ tài khoản
Khi chủ tài khoản đưa bạn file .p12 và provisioning profile. Chi tiết: Ký app iOS khi không phải chủ tài khoản.
Set up iOS code signing for this project with appship-ai. I am not the account owner; the owner gave me a .p12 (Apple Distribution certificate) and App Store .mobileprovision files.
Guide: https://appship.ketchsoft.com/docs.html#not-owner
1. Ask me where the files are. They must be inside release/keys/ (gitignored); tell me to move them there if they are not. Do not open, print or copy them yourself.
2. Add an ios.signing block to release/release.yml (style: manual, certificate, profiles: one per bundle id, including extensions).
3. Change ios.build_command so the build uses "$APPSHIP_EXPORT_OPTIONS" (for Flutter: --export-options-plist="$APPSHIP_EXPORT_OPTIONS"; for xcodebuild/gym: the matching export options flag).
4. Run `appship signing import --dry-run` and show me the result. I will run the real import in my own terminal, because it asks for the .p12 password.
5. Run `appship doctor` and explain every signing error or warning (profile type, expiry, team, bundle id, certificate in the keychain).
Never commit anything in release/keys/. Do not commit or push unless I ask. Reply in the language I write in.
1Yêu cầu
| Bạn cần | Ghi chú |
|---|---|
| Node.js 22 trở lên | appship là một package npm. |
| fastlane | appship chạy fastlane cho mọi lệnh gọi store. Cài theo cách tài liệu fastlane khuyến nghị cho máy của bạn. |
| macOS và Xcode | Chỉ cần để build và upload iOS. Dự án chỉ có Android cũng chạy được trên Linux. |
| Apple Developer Program | 99 USD/năm. |
| Tài khoản Google Play Console | 25 USD, trả một lần. |
| App build được bản release đã ký | appship không ký thay bạn. Xem Ký app. |
2Cài đặt
Cài appship một lần cho mỗi máy, ở chế độ global. Không có gì được thêm vào package.json của app.
npm i -g appship-ai
appship --version
Package tên là appship-ai và cài lệnh appship. Muốn dùng thử mà không cài, chạy npx appship-ai --help.
3Lấy key của store
Bạn làm bước này một lần cho mỗi tài khoản developer, không phải mỗi dự án. Cả hai key đều có thể publish build dưới tên bạn, vì vậy đừng bao giờ commit chúng lên git.
iOS: App Store Connect API key
- Trong App Store Connect, mở Users and Access → Integrations → App Store Connect API.
- Ở mục Team Keys, bấm +. Đặt tên
appshipvà cấp role App Manager. - Tải
AuthKey_XXXXXXXXXX.p8. Apple chỉ cho tải file này một lần. - Ghi lại Key ID (10 ký tự, cũng nằm trong tên file) và Issuer ID (chuỗi UUID phía trên bảng key).
Chỉ Account Holder hoặc Admin mới tạo được Team Key. Nếu bạn không phải, hãy nhờ owner gửi key, hoặc xem Ký app iOS khi không phải chủ tài khoản để dùng key cá nhân.
Apple ID (email) là tùy chọn. Chỉ cần để tạo app record và upload câu trả lời App Privacy, vì API key của Apple không làm được hai việc này. Apple ID cần 2FA nên không bao giờ chạy được trong CI.
Android: service account của Google Play
- Trong Google Cloud Console, chọn một project và bật Google Play Android Developer API.
- Vào IAM & Admin → Service Accounts → Create service account. Không cần gán role GCP nào.
- Mở account vừa tạo, rồi vào Keys → Add key → JSON để tải file key.
- Trong Play Console, vào Users and permissions → Invite new users và mời
client_emaillấy từ file JSON. Cấp các quyền Release apps to testing tracks, Release to production và Manage store presence. - Chờ vài phút để quyền có hiệu lực. Với tài khoản mới có thể mất tới 24 giờ.
Lưu thành profile
Profile sao chép các key vào ~/.appship/credentials/<name>/ với mode 600, để mọi dự án trên máy này dùng chung. Chạy không kèm flag để được hỏi từng bước.
appship credentials add my-company \
--asc-key ~/Downloads/AuthKey_ABC123DEFG.p8 \
--asc-key-id ABC123DEFG \
--asc-issuer-id 69a6de7a-0000-0000-0000-000000000000 \
--play-json ~/Downloads/play-service-account.json
appship credentials list
4Gắn tool vào dự án
Chạy init từ thư mục gốc của repo app.
cd ~/Projects/my-app
appship init --profile my-company
init nhận diện dự án Flutter, React Native, Cocos Creator hoặc native, đọc bundle id và package name, rồi điền sẵn build command và đường dẫn artifact. Lệnh này tạo thư mục dưới đây và thêm release/keys/* cùng release/.appship/ vào .gitignore:
my-app/
└── release/
├── release.yml # id, artifact, build command, track, credentials
├── questionnaire.yml # câu trả lời cho các câu hỏi của store
├── ios/metadata/<locale>/*.txt
├── ios/screenshots/<locale>/*.png
├── android/metadata/<locale>/{*.txt, images/}
├── keys/ # đã gitignore; chỉ dùng nếu bạn không dùng profile
└── .appship/ # đã gitignore; file tạm cho fastlane
Mở release/release.yml và kiểm tra artifact cùng build_command của từng nền tảng. Với app Flutter, file trông như sau:
app:
name: "My App"
primary_locale: en-US
ios:
bundle_id: com.example.myapp
artifact: "build/ios/ipa/*.ipa"
build_command: "flutter build ipa --release"
upload_screenshots: true
submit:
automatic_release: false # phát hành ngay khi Apple duyệt
phased_release: false # phát hành dần trong 7 ngày
android:
package_name: com.example.myapp
artifact: "build/app/outputs/bundle/release/*.aab"
build_command: "flutter build appbundle --release"
track: internal # internal | alpha | beta | production
release_status: completed # dùng draft khi app chưa publish
rollout: 1 # 0.2 = staged rollout 20%
credentials:
profile: my-company
Commit cả thư mục release/ trừ keys/ và .appship/. Repo của bạn không có Fastfile: logic release nằm trong appship, nên cập nhật appship là cập nhật cho mọi dự án.
5Điền nội dung store
Nếu app đã có trên store, hãy kéo nội dung hiện tại về thay vì gõ tay:
appship metadata pull
Nếu không, thay mọi TODO trong các file sau:
release/questionnaire.yml: age rating, export compliance, content rights, thông tin liên hệ cho reviewer, App Privacy và các câu trả lời App content của Android.- Văn bản:
release/ios/metadata/<locale>/*.txtvàrelease/android/metadata/<locale>/*.txt. - Release notes theo từng ngôn ngữ: mỗi locale một thư mục. Xem Ngôn ngữ và release notes bên dưới.
- Screenshot iOS trong
release/ios/screenshots/<locale>/: tối thiểu một bộ iPhone 6.9" (1320×2868) hoặc 6.5" (1284×2778). - Ảnh Android trong
release/android/metadata/<locale>/images/:icon.png512×512,featureGraphic.png1024×500 và tối thiểu 2 ảnh trongphoneScreenshots/.
Ngôn ngữ và release notes
Cả hai store đều nhận một đoạn "What's New" riêng cho mỗi ngôn ngữ. Mỗi ngôn ngữ là một thư mục, và mỗi thư mục chứa release notes của riêng nó:
| Store | File, mỗi thư mục locale một file | Tối đa |
|---|---|---|
| App Store | release/ios/metadata/<locale>/ | 4000 ký tự |
| Google Play | release/android/metadata/<locale>/ | 500 ký tự |
Để thêm một ngôn ngữ:
- Khai báo nó trong
release.yml. Danh sách này là tùy chọn; nếu không có, appship dùng mọi thư mục tìm thấy. iOS và Android dùng mã locale khác nhau, nên mỗi nền tảng có danh sách riêng:release/release.ymlios: locales: [en-US, vi, ja] android: locales: [en-US, vi, ja-JP] # mã của Play khác iOS, ví dụ zh-CN ở đây, zh-Hans trên iOS - Tạo thư mục, ví dụ
release/ios/metadata/vi/, rồi điền các file bắt buộc:name.txt,description.txt,keywords.txt,support_url.txt,privacy_url.txtvàrelease_notes.txtcho iOS;title.txt,short_description.txt,full_description.txtvàchangelogs/default.txtcho Android. - Thêm screenshot iOS vào
release/ios/screenshots/<locale>/. Với Android, hãy bật ngôn ngữ đó trong Play Console trước. - Chạy
appship doctor. Locale có trong danh sách nhưng không có thư mục là lỗi. Thư mục không có trong danh sách chỉ là cảnh báo, vì nó vẫn được đẩy lên store.
Cần lưu ý:
- Bạn không cần thêm ngôn ngữ trong App Store Connect trước. Ngôn ngữ được tạo khi metadata được đẩy lên.
- Để trống
release_notes.txtcho phiên bản đầu tiên của app. Apple không nhận release notes ở phiên bản 1.0. - Locale không có release notes sẽ hiện "What's New" trống ở ngôn ngữ đó.
doctorcảnh báo khi một số locale có notes còn số khác thì không. - Tên thư mục iOS phải là một trong các mã của Apple, như
en-US,vi,ja,ko,de-DE,fr-FR,es-ES,pt-BR,zh-Hanshoặczh-Hant.doctortừ chối mọi mã khác, ví dụzh-CN. - Thư mục
defaultdùng chung của fastlane chưa được hỗ trợ.
Ngôn ngữ gợi ý
Chưa biết nên thêm ngôn ngữ nào tiếp theo? appship gợi ý sáu ngôn ngữ có lượng người dùng lớn: tiếng Tây Ban Nha (Tây Ban Nha và Mỹ Latin), tiếng Bồ Đào Nha (Brazil), tiếng Đức, tiếng Pháp, tiếng Nhật và tiếng Hàn. Hai store dùng mã khác nhau:
| Ngôn ngữ | id cho --locales | Thư mục iOS | Thư mục Android |
|---|---|---|---|
| Tiếng Tây Ban Nha, Tây Ban Nha | es | es-ES | es-ES |
| Tiếng Tây Ban Nha, Mỹ Latin | es | es-MX | es-419 |
| Tiếng Bồ Đào Nha, Brazil | pt-BR | pt-BR | pt-BR |
| Tiếng Đức | de | de-DE | de-DE |
| Tiếng Pháp | fr | fr-FR | fr-FR |
| Tiếng Nhật | ja | ja | ja-JP |
| Tiếng Hàn | ko | ko | ko-KR |
- Tạo các thư mục ngay khi thiết lập dự án:
appship init --locales presetcho cả sáu ngôn ngữ, hoặc--locales es,jacho một số ngôn ngữ. Lệnh ghilocalescho từng nền tảng với đúng mã và tạo các file listing điền sẵnTODOđể bạn dịch.doctorbáo lỗi cho đến khi mọiTODOđược thay. - Với dự án đã có sẵn, hãy thêm thư mục bằng tay theo các mã ở trên (
init --forcesẽ ghi đèrelease.yml). - Chỉ giữ biến thể tiếng Tây Ban Nha mà bạn thực sự sẽ viết.
es-MXtrên iOS vàes-419trên Play đều bao phủ toàn bộ Mỹ Latin. - Giới hạn của store tính theo ký tự, không phải byte hay từ. Văn bản tiếng Nhật và tiếng Hàn thường ngắn hơn tiếng Anh; tiếng Đức và tiếng Pháp dài hơn và hay chạm giới hạn 30 ký tự của tiêu đề.
- Bật từng ngôn ngữ trong Play Console trước khi upload.
doctorcảnh báo thư mục Android không phải mã ngôn ngữ của Play và gợi ý cách sửa, ví dụjaphải làja-JP. - Skill
release-notesnắm quy ước của từng ngôn ngữ: xưng hô trang trọng hay thân mật, biến thể theo vùng, dấu câu full-width của tiếng Nhật và khoảng trắng trước? ! : ;trong tiếng Pháp.
Viết release notes bằng AI coding agent
appship init cài một skill tên release-notes cho AI coding agent của bạn (Claude Code, Codex hoặc Antigravity): vào .claude/skills/ với Claude Code, .agents/skills/ với Codex và Antigravity. Trước khi release, hãy nhờ agent "write the release notes for this version" (hoặc chạy /release-notes trong Claude Code, $release-notes trong Codex). Skill sẽ:
- Đọc
release.ymlvà các thư mục locale. - Đọc
git logtừ tag gần nhất, vàCHANGELOG.mdnếu bạn có. - Viết release notes ngắn, hướng tới người dùng bằng ngôn ngữ chính của bạn, rồi dịch sang mọi locale còn lại.
- Điều chỉnh cho vừa giới hạn của store, ghi file, rồi chạy
appship doctor.
Release notes vẫn là file thường, nên bạn có thể xem lại và sửa. Skill hỏi trước khi ghi đè nội dung đã có, và không bao giờ đẩy gì lên store.
Ảnh chụp màn hình và khai báo store bằng AI agent
init cài thêm hai skill nữa bên cạnh. Giống release-notes, chúng chỉ ghi file trong release/, chạy appship doctor, và để việc đẩy lên store cho bạn.
store-screenshots: cùng bạn lên kế hoạch các ảnh, chụp từ iOS Simulator hoặc Android emulator, thêm một dòng tiêu đề đã dịch cho từng ngôn ngữ, và xuất mọi ảnh ở kích thước mà từng store chấp nhận (iPhone 6.9" 1320×2868, iPad 13" khi app chạy trên iPad, Play 1080×1920), kèm icon và feature graphic cho Play.app-content: điềnrelease/questionnaire.yml(age rating, App Privacy, export compliance, Data safety, content rating, đối tượng mục tiêu, quảng cáo, quyền truy cập app) dựa trên dependency, quyền và code của bạn, hỏi bạn những gì code không thể hiện được, và giữ câu trả lời nhất quán giữa hai store.
| Agent | Thư mục skill | Cách chạy |
|---|---|---|
| Claude Code | .claude/skills/ | /store-screenshots |
| Codex | .agents/skills/ | $store-screenshots hoặc /skills |
| Antigravity | .agents/skills/ | nhờ "use the store-screenshots skill" |
appship không tự gọi AI nào. Bạn mở agent ở thư mục gốc của dự án, đăng nhập bằng tài khoản của chính bạn, và duyệt các lệnh mà agent xin chạy.
Chọn agent khi chạy init, hoặc cài và cập nhật skill sau, chẳng hạn sau khi nâng cấp appship:
appship init --agents all # skill cho Claude Code, Codex và Antigravity
appship skills # mỗi agent đang có những skill nào
appship skills add --agent codex # cài cho Codex / Antigravity (.agents/skills/)
appship skills add --force # thay bằng bản của phiên bản này
6Kiểm tra bằng doctor
doctor kiểm tra tool, config, key, artifact, giới hạn ký tự, kích thước ảnh và văn bản placeholder, và báo lỗi nếu có file key đang được git theo dõi. Lặp lại cho đến khi không còn ✗. Dấu ! là cảnh báo và không chặn release.
▸ Security
✓ No key files tracked by git
✓ .gitignore protects release/keys/
▸ iOS · store listing
✗ ios/metadata/en-US/subtitle.txt is 34 characters (max 30)
▸ Android · store listing
✓ Metadata OK for en-US
✗ 1 error(s), 0 warning(s)
7Release lần đầu
appship build
appship first-release --create-app
- iOS: tạo app trên App Store Connect (cần Apple ID và có thể hỏi mã 2FA), rồi đẩy listing, screenshot, age rating, review info và App Privacy.
- Android: Google Play không có API để tạo app, nên appship in ra các bước cần làm.
- Cả hai đều ghi
release/CHECKLIST.md: các bước trên console phải làm tay, kèm câu trả lời lấy từquestionnaire.ymlđể bạn chép sang.
Trên Google Play, làm theo checklist để:
- Tạo app trong Play Console.
- Mời service account vào app.
- Upload bản
.aabđầu tiên bằng tay lên Internal testing. - Điền mục App content.
Khi app Android chưa từng được publish, đặt release_status: draft trong release.yml. Tài khoản developer cá nhân mới còn phải chạy closed test với 12 tester trong 14 ngày trước khi lên production.
Sau đó hoàn tất release lần đầu:
appship metadata --android
appship upload
appship submit
8Những lần release sau
Tăng version và build number trong dự án, rồi:
# nhờ AI agent viết release notes (xem Ngôn ngữ và release notes)
appship upload --build # build, rồi TestFlight + track Google Play (mặc định internal)
# test trên TestFlight / internal track
appship submit # iOS: App Review · Android: promote lên production
appship status # trạng thái review và các phiên bản trên cả hai store
Để staged rollout trên Android:
appship submit --android --rollout 10%
appship promote --from production --to production --rollout 50%
appship promote --from production --to production --rollout 100%
Mọi lệnh ghi lên store đều hỏi xác nhận trước. Thêm --dry-run để xem chính xác những gì sẽ được gửi đi.
9Chạy trong CI
Trong CI, key lấy từ secret qua các biến môi trường APPSHIP_*, và mọi lệnh ghi đều cần --yes. Thêm các secret sau vào repository (trên GitHub: Settings → Secrets and variables → Actions):
| Secret | Giá trị |
|---|---|
APPSHIP_ASC_KEY_ID | Key ID |
APPSHIP_ASC_ISSUER_ID | Issuer ID |
APPSHIP_ASC_KEY | Kết quả của base64 -i AuthKey_XXX.p8 |
APPSHIP_PLAY_JSON | Kết quả của base64 -i play-service-account.json |
| Secret dùng để ký | Tùy cách bạn ký, ví dụ MATCH_PASSWORD cho fastlane match, hoặc keystore Android dạng base64 |
Các bước release của một workflow GitHub Actions:
env:
APPSHIP_ASC_KEY_ID: ${{ secrets.APPSHIP_ASC_KEY_ID }}
APPSHIP_ASC_ISSUER_ID: ${{ secrets.APPSHIP_ASC_ISSUER_ID }}
APPSHIP_ASC_KEY: ${{ secrets.APPSHIP_ASC_KEY }}
APPSHIP_PLAY_JSON: ${{ secrets.APPSHIP_PLAY_JSON }}
jobs:
release:
runs-on: macos-latest # build iOS cần macOS
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 22 }
# ...toolchain, fastlane và bước thiết lập ký của bạn...
- run: npm i -g appship-ai
- run: appship doctor --skip-artifacts
- run: appship upload --build --yes
- if: ${{ inputs.submit }}
run: appship submit --yes
Hãy thêm phần thiết lập Flutter, bước ký của bạn và, nếu muốn kích hoạt submit bằng tay, một input workflow_dispatch như ở trên.
- Tạo app iOS và upload App Privacy cần Apple ID với 2FA. Hãy làm các việc này một lần trên máy của bạn, không làm trong CI.
- Để ghim phiên bản fastlane, dùng Gemfile và đặt
APPSHIP_FASTLANE="bundle exec fastlane". - Chạy thử toàn bộ pipeline với
--dry-runtrước khi cho nó đẩy bất cứ thứ gì.
Tham khảo
Ký app
appship không build hay ký app của bạn. Nó chạy build_command của bạn và lấy artifact đã ký.
- iOS: cách đơn giản nhất là để Xcode tự ký (Automatic signing, trong Signing & Capabilities). Với team và CI, dùng fastlane match.
- Android: tạo upload keystore, cấu hình
signingConfigstrong Gradle, và bật Play App Signing ở lần upload đầu tiên. Giữ keystore ngoài git, ví dụ trong thư mụcrelease/keys/đã gitignore.
Ký app iOS khi không phải chủ tài khoản
Trên iOS, ký app và upload app cần những thứ khác nhau, và cả hai thường do Account Holder hoặc Admin nắm. appship vẫn không build hay ký thay bạn. Nó kiểm tra các file bạn được đưa, cài chúng, và truyền cách ký cho build command của bạn.
| Tình huống của bạn | Ký bằng | Upload bằng |
|---|---|---|
| Account Holder hoặc Admin | Automatic signing, hoặc fastlane match | Team API key |
| Owner gửi file signing và team API key | File ios.signing | Team API key |
| Owner gửi file signing, không có API key | File ios.signing | API key cá nhân của bạn |
| Không có API key nào | File ios.signing | Transporter hoặc Xcode Organizer, làm tay |
| Owner chỉ gửi API key | Xin certificate và profile, hoặc dùng Xcode automatic signing nếu role của bạn cho phép | API key |
Nhờ owner gửi
- Certificate Apple Distribution dạng
.p12, export từ Keychain Access kèm mật khẩu. File phải có private key. - Provisioning profile loại App Store (
.mobileprovision) cho từng bundle id, kể cả app extension. - Tùy chọn: team API key gồm
.p8, Key ID và Issuer ID.
Để tránh phải chuyển private key qua lại, hãy tự tạo certificate signing request trên Mac của bạn và nhờ owner cấp certificate từ đó. Khi đó private key không bao giờ rời máy bạn, và bạn không cần .p12.
Khai báo và cài đặt
ios:
bundle_id: com.example.app
team_id: ABCDE12345
build_command: 'flutter build ipa --release --export-options-plist="$APPSHIP_EXPORT_OPTIONS"'
signing:
style: manual
certificate: release/keys/AppleDistribution.p12
profiles: [release/keys/AppStore.mobileprovision]
APPSHIP_P12_PASSWORD=... appship signing import # cài profile, import .p12
appship build --ios
appship doctor # kiểm tra profile, keychain và file .ipa đã build
appship upload --ios
Mật khẩu .p12 không bao giờ được lưu trong release.yml; hãy truyền qua APPSHIP_P12_PASSWORD. Build command nhận $APPSHIP_EXPORT_OPTIONS (một file ExportOptions.plist được tạo tự động), $APPSHIP_IOS_BUNDLE_ID và $APPSHIP_IOS_TEAM_ID. Với fastlane gym, dùng --export_options "$APPSHIP_EXPORT_OPTIONS". File plist chỉ điều khiển bước export; với manual signing, hãy tắt automatic signing trong project Xcode để bước archive dùng cùng profile.
Những gì doctor kiểm tra
- Mỗi profile là profile iOS loại App Store, chưa hết hạn (cảnh báo khi còn dưới 30 ngày), thuộc team trong
ios.team_idvà áp dụng choios.bundle_id. - File
.p12tồn tại và không cho mọi người đọc, và keychain có certificate khớp kèm private key (chỉ trên macOS). - File
.ipađã build được ký đúng bundle id, bằng profile hợp lệ trongios.signing.profiles. build_commandthực sự dùng$APPSHIP_EXPORT_OPTIONS.
Không có team API key
- Key cá nhân: trong App Store Connect, Integrations → Individual Keys. Loại key này không có Issuer ID, nên để trống
issuer_id:appship credentials add my-key --asc-key AuthKey_XXX.p8 --asc-key-id XXXXXXXXXX. Key mang quyền của role của chính bạn, và Admin có thể tắt tính năng này. Chưa được kiểm chứng trên tài khoản thật. - Không có key nào: ký và build theo cách tương tự, rồi upload file
.ipabằng Transporter hoặc Xcode → Organizer → Distribute App.doctorvẫn kiểm tra file trước. appship không upload bằng Apple ID, vì cách đó cần 2FA tương tác.
Trong CI
- run: |
mkdir -p release/keys
echo "$P12_B64" | base64 --decode > release/keys/AppleDistribution.p12
echo "$PROFILE_B64" | base64 --decode > release/keys/AppStore.mobileprovision
env: { P12_B64: ${{ secrets.IOS_DIST_P12_BASE64 }}, PROFILE_B64: ${{ secrets.IOS_PROFILE_BASE64 }} }
- run: appship signing import --yes --keychain "$RUNNER_TEMP/appship.keychain-db"
env:
APPSHIP_P12_PASSWORD: ${{ secrets.IOS_DIST_P12_PASSWORD }}
APPSHIP_KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
Lệnh này tạo một keychain riêng, nên login keychain của runner không bị đụng tới. Profile và certificate hết hạn sau khoảng một năm; doctor cảnh báo trước 30 ngày.
Mỗi role được phép làm những việc khác nhau; hãy xem bảng role trong App Store Connect Help. Giao diện của Apple thay đổi, nên hãy coi các bước này đúng tại thời điểm 09/2026.
Nơi đọc key
Với mỗi giá trị, nguồn đầu tiên tìm thấy sẽ được dùng. Bạn có thể kết hợp các nguồn, ví dụ dùng profile trên máy và biến môi trường trong CI.
- Biến môi trường:
APPSHIP_ASC_KEY_ID,APPSHIP_ASC_ISSUER_ID,APPSHIP_ASC_KEY_PATHhoặcAPPSHIP_ASC_KEY(nội dung, dạng thường hoặc base64),APPSHIP_APPLE_ID,APPSHIP_PLAY_JSON_PATHhoặcAPPSHIP_PLAY_JSON, vàAPPSHIP_PROFILE. release/release.yml: đường dẫn tới các file trongrelease/keys/đã gitignore. Key ID và Issuer ID không phải bí mật và có thể commit.- Một profile:
credentials.profile: my-company, trỏ tới~/.appship/credentials/my-company/.
credentials:
ios:
key_id: ABC123DEFG
issuer_id: 69a6de7a-0000-0000-0000-000000000000
key_path: release/keys/AuthKey_ABC123DEFG.p8
apple_id: you@example.com # tùy chọn
android:
json_key_path: release/keys/play-service-account.json
Nếu lỡ commit key
- Thu hồi key ngay. iOS: App Store Connect → Integrations → Revoke. Android: Cloud Console → service account → Keys → Delete.
- Tạo key mới và cập nhật profile hoặc secret trong CI.
- Chạy
git rm --cached <file>. Key vẫn còn trong lịch sử git, vì vậy thu hồi key mới là bước quan trọng.