distributing-tauri-for-ios
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDistributing Tauri Apps for iOS
将Tauri应用分发至iOS平台
This skill covers the complete process of distributing Tauri v2 applications to Apple's iOS App Store.
本指南涵盖了将Tauri v2应用分发至苹果iOS App Store的完整流程。
Prerequisites
前置条件
Before distributing a Tauri iOS app, ensure:
- macOS development machine (required for iOS builds)
- Xcode installed with iOS SDK
- Apple Developer Program enrollment ($99/year)
- Tauri project initialized for iOS ()
tauri ios init
在分发Tauri iOS应用前,请确保满足以下条件:
- macOS开发机器(iOS构建必需)
- 安装了iOS SDK的Xcode
- Apple Developer Program注册(年费99美元)
- 已为iOS初始化Tauri项目()
tauri ios init
Apple Developer Program Enrollment
Apple Developer计划注册
Enroll at developer.apple.com/programs:
- Sign in with Apple ID
- Accept the Apple Developer Agreement
- Complete enrollment (individual or organization)
- Wait for approval (typically 24-48 hours)
前往developer.apple.com/programs完成注册:
- 使用Apple ID登录
- 接受Apple Developer协议
- 完成注册流程(个人或企业账号均可)
- 等待审核通过(通常需要24-48小时)
Bundle Identifier Configuration
Bundle Identifier配置
The bundle identifier must be unique and match across all configurations.
Bundle Identifier必须唯一,且在所有配置中保持一致。
tauri.conf.json
tauri.conf.json
json
{
"identifier": "com.yourcompany.yourapp",
"version": "1.0.0",
"bundle": {
"iOS": {
"bundleVersion": "1"
}
}
}Configuration notes:
- : Reverse-domain format, must match App Store Connect
identifier - : Becomes
version(user-visible version)CFBundleShortVersionString - : Becomes
bundleVersion(build number, must increment for each upload)CFBundleVersion
json
{
"identifier": "com.yourcompany.yourapp",
"version": "1.0.0",
"bundle": {
"iOS": {
"bundleVersion": "1"
}
}
}配置说明:
- : 反向域名格式,必须与App Store Connect中的配置完全匹配
identifier - : 对应
version(用户可见的版本号)CFBundleShortVersionString - : 对应
bundleVersion(构建号,每次上传必须递增)CFBundleVersion
Register Bundle ID in App Store Connect
在App Store Connect中注册Bundle ID
- Go to Certificates, Identifiers & Profiles
- Click "+" to register a new identifier
- Select "App IDs" then "App"
- Enter description and explicit Bundle ID matching
tauri.conf.json - Select required capabilities
- Click "Register"
- 访问Certificates, Identifiers & Profiles
- 点击「+」注册新标识符
- 选择「App IDs」然后选择「App」
- 输入描述信息,并填写与一致的显式Bundle ID
tauri.conf.json - 选择所需的功能权限
- 点击「Register」完成注册
Code Signing Setup
代码签名设置
Create Certificates
创建证书
Distribution Certificate (required for App Store):
- Open Keychain Access on macOS
- Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority
- Enter email, select "Saved to disk"
- Go to Certificates
- Click "+" and select "Apple Distribution"
- Upload the certificate signing request
- Download and double-click to install
分发证书(App Store必需):
- 在macOS上打开Keychain Access
- 依次选择Keychain Access > Certificate Assistant > Request a Certificate from a Certificate Authority
- 输入邮箱地址,选择「Saved to disk」
- 访问Certificates
- 点击「+」并选择「Apple Distribution」
- 上传证书签名请求文件
- 下载证书并双击安装
Create Provisioning Profile
创建配置描述文件
App Store Distribution Profile:
- Go to Profiles
- Click "+" to create new profile
- Select "App Store Connect" under Distribution
- Select your App ID
- Select your distribution certificate
- Name and generate the profile
- Download the file
.mobileprovision
App Store分发配置描述文件:
- 访问Profiles
- 点击「+」创建新配置文件
- 在分发类型中选择「App Store Connect」
- 选择你的App ID
- 选择你的分发证书
- 命名并生成配置文件
- 下载文件
.mobileprovision
Install Provisioning Profile
安装配置描述文件
bash
undefinedbash
undefinedCopy to Xcode provisioning profiles directory
复制到Xcode配置描述文件目录
cp ~/Downloads/YourApp_AppStore.mobileprovision
~/Library/MobileDevice/Provisioning\ Profiles/
~/Library/MobileDevice/Provisioning\ Profiles/
Or double-click the file to install automatically.cp ~/Downloads/YourApp_AppStore.mobileprovision
~/Library/MobileDevice/Provisioning\ Profiles/
~/Library/MobileDevice/Provisioning\ Profiles/
或直接双击文件自动安装。Xcode Project Configuration
Xcode项目配置
Open the Tauri iOS project in Xcode:
bash
tauri ios build --open在Xcode中打开Tauri iOS项目:
bash
tauri ios build --openConfigure Signing in Xcode
在Xcode中配置签名
- Select the project in the navigator
- Select your app target
- Go to "Signing & Capabilities" tab
- Uncheck "Automatically manage signing" for manual control
- Select your Team
- Select the App Store provisioning profile
- 在导航栏中选择项目
- 选择你的应用目标
- 切换到「Signing & Capabilities」标签页
- 取消勾选「Automatically manage signing」以手动控制
- 选择你的开发团队
- 选择App Store分发配置描述文件
Required Capabilities
必需的功能权限
Add capabilities based on app requirements:
| Capability | When Required |
|---|---|
| Push Notifications | If using APNs |
| Background Modes | For background tasks |
| App Groups | For sharing data between extensions |
| Associated Domains | For universal links |
根据应用需求添加相应的功能权限:
| 功能权限 | 适用场景 |
|---|---|
| Push Notifications | 使用APNs推送通知时 |
| Background Modes | 需要后台任务时 |
| App Groups | 需在扩展与主应用间共享数据时 |
| Associated Domains | 使用通用链接时 |
Info.plist Configuration
Info.plist配置
Located at :
src-tauri/gen/apple/[AppName]_iOS/Info.plistxml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Your App Name</string>
<key>CFBundleName</key>
<string>YourApp</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSCameraUsageDescription</key>
<string>This app requires camera access for...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires photo library access for...</string>
</dict>
</plist>Required usage descriptions (add only if your app uses these features):
- : Camera access
NSCameraUsageDescription - : Photo library
NSPhotoLibraryUsageDescription - : Location services
NSLocationWhenInUseUsageDescription - : Microphone access
NSMicrophoneUsageDescription
配置文件路径::
src-tauri/gen/apple/[AppName]_iOS/Info.plistxml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDisplayName</key>
<string>Your App Name</string>
<key>CFBundleName</key>
<string>YourApp</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSCameraUsageDescription</key>
<string>This app requires camera access for...</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>This app requires photo library access for...</string>
</dict>
</plist>必需的权限描述(仅当应用使用对应功能时添加):
- : 相机访问权限说明
NSCameraUsageDescription - : 相册访问权限说明
NSPhotoLibraryUsageDescription - : 定位服务权限说明
NSLocationWhenInUseUsageDescription - : 麦克风访问权限说明
NSMicrophoneUsageDescription
App Icons
应用图标
Generate iOS app icons from a source image (1024x1024 recommended):
bash
tauri icon /path/to/app-icon.png --ios-color '#ffffff'This generates all required icon sizes in .
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/从源图片(推荐尺寸1024x1024)生成iOS应用图标:
bash
tauri icon /path/to/app-icon.png --ios-color '#ffffff'该命令会在目录下生成所有所需尺寸的图标。
src-tauri/gen/apple/Assets.xcassets/AppIcon.appiconset/Building for App Store
为App Store构建应用
Command Line Build
命令行构建
bash
undefinedbash
undefinedBuild IPA for App Store Connect
构建用于App Store Connect的IPA文件
tauri ios build --export-method app-store-connect
The IPA is generated at:src-tauri/gen/apple/build/arm64/[AppName].ipa
undefinedtauri ios build --export-method app-store-connect
IPA文件生成路径:src-tauri/gen/apple/build/arm64/[AppName].ipa
undefinedBuild Options
构建选项
bash
undefinedbash
undefinedBuild with specific target
指定目标架构构建
tauri ios build --target aarch64-apple-ios --export-method app-store-connect
tauri ios build --target aarch64-apple-ios --export-method app-store-connect
Build in release mode (default for export-method)
以Release模式构建(export-method默认模式)
tauri ios build --release --export-method app-store-connect
tauri ios build --release --export-method app-store-connect
Build and open in Xcode for manual archive
构建并在Xcode中打开以手动归档
tauri ios build --open
undefinedtauri ios build --open
undefinedArchive via Xcode (Alternative)
通过Xcode归档(替代方案)
- Open project:
tauri ios build --open - Select "Any iOS Device" as destination
- Product > Archive
- Window > Organizer to view archives
- Click "Distribute App"
- Select "App Store Connect"
- Follow the wizard
- 打开项目:
tauri ios build --open - 选择「Any iOS Device」作为目标设备
- 选择Product > Archive
- 通过Window > Organizer查看归档文件
- 点击「Distribute App」
- 选择「App Store Connect」
- 按照向导完成操作
App Store Connect API Key Setup
App Store Connect API密钥设置
Create an API key for automated uploads:
- Go to App Store Connect > Users and Access
- Select "Integrations" tab
- Click "App Store Connect API" then "+"
- Name the key and select "Admin" or "Developer" role
- Click "Generate"
- Download the file (only available once)
.p8 - Note the Key ID and Issuer ID
创建API密钥以实现自动化上传:
- 访问App Store Connect > Users and Access
- 选择「Integrations」标签页
- 点击「App Store Connect API」然后点击「+」
- 为密钥命名并选择「Admin」或「Developer」角色
- 点击「Generate」生成密钥
- 下载文件(仅可下载一次)
.p8 - 记录Key ID和Issuer ID
Store the API Key
存储API密钥
bash
undefinedbash
undefinedCreate directory
创建目录
mkdir -p ~/.appstoreconnect/private_keys
mkdir -p ~/.appstoreconnect/private_keys
Move the key file (rename to include Key ID)
移动密钥文件(重命名以包含Key ID)
mv ~/Downloads/AuthKey_XXXXXXXXXX.p8 ~/.appstoreconnect/private_keys/
mv ~/Downloads/AuthKey_XXXXXXXXXX.p8 ~/.appstoreconnect/private_keys/
Alternative location
可选存储位置
mkdir -p ~/private_keys
mv ~/Downloads/AuthKey_XXXXXXXXXX.p8 ~/private_keys/
undefinedmkdir -p ~/private_keys
mv ~/Downloads/AuthKey_XXXXXXXXXX.p8 ~/private_keys/
undefinedEnvironment Variables (Optional)
环境变量(可选)
bash
export APPLE_API_KEY_ID="XXXXXXXXXX"
export APPLE_API_ISSUER="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"bash
export APPLE_API_KEY_ID="XXXXXXXXXX"
export APPLE_API_ISSUER="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"Uploading to App Store Connect
上传至App Store Connect
Using altool
使用altool工具
bash
xcrun altool --upload-app \
--type ios \
--file "src-tauri/gen/apple/build/arm64/YourApp.ipa" \
--apiKey "$APPLE_API_KEY_ID" \
--apiIssuer "$APPLE_API_ISSUER"bash
xcrun altool --upload-app \
--type ios \
--file "src-tauri/gen/apple/build/arm64/YourApp.ipa" \
--apiKey "$APPLE_API_KEY_ID" \
--apiIssuer "$APPLE_API_ISSUER"Using Transporter App
使用Transporter应用
- Download Transporter from Mac App Store
- Sign in with Apple ID
- Drag and drop the IPA file
- Click "Deliver"
- 从Mac App Store下载Transporter
- 使用Apple ID登录
- 拖拽IPA文件到应用中
- 点击「Deliver」完成上传
Using Xcode Organizer
使用Xcode Organizer
- Window > Organizer
- Select your archive
- Click "Distribute App"
- Select "App Store Connect"
- Choose "Upload" or "Export"
- Follow prompts
- 打开Window > Organizer
- 选择你的归档文件
- 点击「Distribute App」
- 选择「App Store Connect」
- 选择「Upload」或「Export」
- 按照提示完成操作
TestFlight Beta Testing
TestFlight Beta测试
After upload processing (typically 15-30 minutes):
上传完成后通常需要15-30分钟处理:
Internal Testing
内部测试
- App Store Connect > Your App > TestFlight
- Add internal testers (up to 100, must be App Store Connect users)
- Testers receive email invitation
- 进入App Store Connect > 你的应用 > TestFlight
- 添加内部测试人员(最多100人,必须是App Store Connect用户)
- 测试人员会收到邮件邀请
External Testing
外部测试
- Create a test group
- Add build to the group
- Submit for Beta App Review (required for external testers)
- Add external testers (up to 10,000)
- Testers install via TestFlight app
- 创建测试分组
- 将构建版本添加到分组
- 提交Beta应用审核(外部测试人员必需)
- 添加外部测试人员(最多10,000人)
- 测试人员通过TestFlight应用安装
App Store Submission
App Store提交
Create App in App Store Connect
在App Store Connect中创建应用
- Go to App Store Connect
- My Apps > "+" > New App
- Select iOS platform
- Enter app name, primary language, bundle ID, SKU
- Click "Create"
- 访问App Store Connect
- 进入My Apps > 「+」 > New App
- 选择iOS平台
- 输入应用名称、主语言、Bundle ID、SKU
- 点击「Create」
Prepare App Store Listing
准备App Store应用信息
Required assets:
| Asset | Specification |
|---|---|
| Screenshots | 6.7" (1290x2796), 6.5" (1284x2778), 5.5" (1242x2208) |
| App Icon | 1024x1024 PNG (no alpha) |
| Description | Up to 4000 characters |
| Keywords | Up to 100 characters |
| Support URL | Required |
| Privacy Policy URL | Required |
必需的资源:
| 资源 | 规格要求 |
|---|---|
| 截图 | 6.7" (1290x2796), 6.5" (1284x2778), 5.5" (1242x2208) |
| 应用图标 | 1024x1024 PNG(无透明通道) |
| 应用描述 | 最多4000字符 |
| 关键词 | 最多100字符 |
| 支持URL | 必填 |
| 隐私政策URL | 必填 |
App Privacy
应用隐私设置
Complete the App Privacy questionnaire:
- App Store Connect > Your App > App Privacy
- Answer questions about data collection
- Specify data types collected
- Indicate data usage purposes
完成应用隐私问卷:
- 进入App Store Connect > 你的应用 > App Privacy
- 回答数据收集相关问题
- 指定收集的数据类型
- 说明数据使用目的
Submit for Review
提交审核
- Select your build in App Store Connect
- Complete all required metadata
- Answer export compliance questions
- Click "Submit for Review"
Review typically takes 24-48 hours.
- 在App Store Connect中选择你的构建版本
- 完成所有必需的元数据填写
- 回答出口合规相关问题
- 点击「Submit for Review」
审核通常需要24-48小时。
Common Issues and Solutions
常见问题与解决方案
Code Signing Errors
代码签名错误
"No signing certificate found"
bash
undefined"未找到签名证书"
bash
undefinedList available certificates
列出可用证书
security find-identity -v -p codesigning
security find-identity -v -p codesigning
Verify certificate is valid
验证证书有效性
security find-certificate -c "Apple Distribution" -p
**"Provisioning profile doesn't match"**
- Ensure bundle ID matches exactly in all locations
- Regenerate provisioning profile if certificates changedsecurity find-certificate -c "Apple Distribution" -p
**"配置描述文件不匹配"**
- 确保所有位置的Bundle ID完全一致
- 若证书变更,重新生成配置描述文件Build Failures
构建失败
"Unsupported architecture"
bash
undefined"不支持的架构"
bash
undefinedEnsure building for correct target
确保为正确的目标架构构建
tauri ios build --target aarch64-apple-ios --export-method app-store-connect
**"Missing entitlements"**
- Check capabilities in Xcode match App ID capabilities
- Regenerate provisioning profile after capability changestauri ios build --target aarch64-apple-ios --export-method app-store-connect
**"缺少权限配置"**
- 检查Xcode中的功能权限与App ID权限是否匹配
- 变更权限后重新生成配置描述文件Upload Errors
上传错误
"Invalid binary"
- Ensure minimum iOS version is set correctly
- Verify all required icons are present
- Check Info.plist has required keys
"Missing compliance"
Add to Info.plist if not using encryption:
xml
<key>ITSAppUsesNonExemptEncryption</key>
<false/>"无效的二进制文件"
- 确保最低iOS版本设置正确
- 验证所有必需图标已存在
- 检查Info.plist包含所有必需的键
"缺少合规声明"
若应用未使用加密,在Info.plist中添加:
xml
<key>ITSAppUsesNonExemptEncryption</key>
<false/>CI/CD Integration
CI/CD集成
GitHub Actions Example
GitHub Actions示例
yaml
name: iOS Release
on:
push:
tags:
- 'v*'
jobs:
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Rust
uses: dtolnay/rust-action@stable
with:
targets: aarch64-apple-ios
- name: Install dependencies
run: npm ci
- name: Install certificate
env:
CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$CERTIFICATE_BASE64" | base64 --decode > $CERTIFICATE_PATH
security create-keychain -p "" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$CERTIFICATE_PASSWORD" \
-A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Install provisioning profile
env:
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
run: |
PP_PATH=$RUNNER_TEMP/profile.mobileprovision
echo -n "$PROVISIONING_PROFILE_BASE64" | base64 --decode > $PP_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/
- name: Build iOS
run: npm run tauri ios build -- --export-method app-store-connect
- name: Upload to App Store Connect
env:
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
run: |
mkdir -p ~/.appstoreconnect/private_keys
echo "$APPLE_API_KEY" > ~/.appstoreconnect/private_keys/AuthKey_$APPLE_API_KEY_ID.p8
xcrun altool --upload-app --type ios \
--file src-tauri/gen/apple/build/arm64/*.ipa \
--apiKey $APPLE_API_KEY_ID \
--apiIssuer $APPLE_API_ISSUERyaml
name: iOS Release
on:
push:
tags:
- 'v*'
jobs:
build-ios:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Rust
uses: dtolnay/rust-action@stable
with:
targets: aarch64-apple-ios
- name: Install dependencies
run: npm ci
- name: Install certificate
env:
CERTIFICATE_BASE64: ${{ secrets.APPLE_CERTIFICATE_BASE64 }}
CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$CERTIFICATE_BASE64" | base64 --decode > $CERTIFICATE_PATH
security create-keychain -p "" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "$CERTIFICATE_PASSWORD" \
-A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: Install provisioning profile
env:
PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }}
run: |
PP_PATH=$RUNNER_TEMP/profile.mobileprovision
echo -n "$PROVISIONING_PROFILE_BASE64" | base64 --decode > $PP_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/
- name: Build iOS
run: npm run tauri ios build -- --export-method app-store-connect
- name: Upload to App Store Connect
env:
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
run: |
mkdir -p ~/.appstoreconnect/private_keys
echo "$APPLE_API_KEY" > ~/.appstoreconnect/private_keys/AuthKey_$APPLE_API_KEY_ID.p8
xcrun altool --upload-app --type ios \
--file src-tauri/gen/apple/build/arm64/*.ipa \
--apiKey $APPLE_API_KEY_ID \
--apiIssuer $APPLE_API_ISSUERVersion Management
版本管理
Incrementing Versions
版本递增
For each App Store submission, increment appropriately:
json
{
"version": "1.0.0",
"bundle": {
"iOS": {
"bundleVersion": "1"
}
}
}- : Increment for user-visible changes (1.0.0 -> 1.0.1 or 1.1.0)
version - : Must increment for every upload (1 -> 2 -> 3)
bundleVersion
每次提交App Store时,需合理递增版本号:
json
{
"version": "1.0.0",
"bundle": {
"iOS": {
"bundleVersion": "1"
}
}
}- : 针对用户可见的变更递增(1.0.0 -> 1.0.1 或 1.1.0)
version - : 每次上传必须递增(1 -> 2 -> 3)
bundleVersion
Version Script Example
版本递增脚本示例
bash
#!/bin/bashbash
#!/bin/bashincrement-build.sh
increment-build.sh
CONFIG="src-tauri/tauri.conf.json"
CURRENT=$(jq -r '.bundle.iOS.bundleVersion' $CONFIG)
NEW=$((CURRENT + 1))
jq ".bundle.iOS.bundleVersion = "$NEW"" $CONFIG > tmp.json && mv tmp.json $CONFIG
echo "Bundle version incremented to $NEW"
undefinedCONFIG="src-tauri/tauri.conf.json"
CURRENT=$(jq -r '.bundle.iOS.bundleVersion' $CONFIG)
NEW=$((CURRENT + 1))
jq ".bundle.iOS.bundleVersion = "$NEW"" $CONFIG > tmp.json && mv tmp.json $CONFIG
echo "Bundle version incremented to $NEW"
undefined