我使用以下方法创建内部博览会版本:
npx eas-cli build --profile preview --platform ios
npx eas-cli build --profile preview --platform android
并且,我使用以下方式发送更新:
npx eas-cli update --branch development --message \"$1\"
我的eas.json看起来像-
{
"cli": {
"version": ">= 2.1.0",
"appVersionSource": "remote",
"promptToConfigurePushNotifications": false
},
"build": {
"development-simulator": {
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"ios": {
"simulator": true
},
"env": {
"EXPO_PUBLIC_APP_ENV": "development"
},
"autoIncrement": true
},
"development": {
"developmentClient": true,
"distribution": "internal",
"channel": "development",
"env": {
"EXPO_PUBLIC_APP_ENV": "development"
},
"autoIncrement": true
},
"preview": {
"distribution": "internal",
"channel": "development",
"env": {
"EXPO_PUBLIC_APP_ENV": "development"
},
"autoIncrement": true
},
"staging": {
"distribution": "internal",
"channel": "staging",
"env": {
"EXPO_PUBLIC_APP_ENV": "staging"
},
"autoIncrement": true
},
"production-internal": {
"distribution": "internal",
"channel": "production",
"env": {
"EXPO_PUBLIC_APP_ENV": "production"
},
"autoIncrement": true
},
"production": {
"distribution": "store",
"channel": "production",
"env": {
"EXPO_PUBLIC_APP_ENV": "production"
},
"autoIncrement": true
}
},
"submit": {
"production": {
"ios": {
"ascAppId": "6473792407",
"appleTeamId": "P3BL9TXLG5"
},
"android": {
"track": "internal",
"releaseStatus": "draft",
"serviceAccountKeyPath": "./android-deployment-service-account.json"
}
}
}
}
如您所见,我自动递增内部版本号 (iOS)/版本代码 (Android)。
当我已经创建了版本号 30 的新版本时,如何专门向版本号 29 发送更新?
目前,我将更新发送到以下分支:
我不确定是否可以针对特定版本或版本来发送更新。如果用户在 2.0 版发布时使用应用程序 1.0 版,则新的更新可能不适用于 1.0 版。如果用户获取更新,可能会破坏应用程序。我怎样才能避免这种情况?
默认情况下,
expo-updates
将根据 Expo SDK 版本进行目标构建。说实话有点奇怪。
要回答您的问题,您需要将
runtimeVersion.policy
配置为 nativeVersion
。它被记录在here。
如果需要,您可以设置特定版本,但将其更改为
nativeVersion
将让expo为您生成它。来自文档:
与此清单关联的运行时版本。将其设置为
以自动生成。
{"policy": "nativeVersion"}
设置后,您的更新现在应该自动针对特定版本+构建,例如
1.0.1+69
。
示例
app.json
{
"expo": {
"runtimeVersion": {
"policy": "nativeVersion"
}
}
}