How to read current app version in Xcode 11 with script

前端 未结 9 1760
野趣味
野趣味 2020-12-14 00:38

Until Xcode 11, I used a script that reads the current app version (for the AppStore) and help me change the LaunchScreen since we can\'t use swift for that

9条回答
  •  死守一世寂寞
    2020-12-14 01:21

    You can use it like any other project variable:

    sourceFilePath="$PROJECT_DIR/$PROJECT_NAME/App/Base.lproj/LaunchScreen.storyboard"
    versionNumber="$MARKETING_VERSION"
    buildNumber="$CURRENT_PROJECT_VERSION"
    
    sed -i .bak -e "/userLabel=\"APP_VERSION_LABEL\"/s/text=\"[^\"]*\"/text=\"v$versionNumber\"/" "$PROJECT_DIR/$PROJECT_NAME/App/Base.lproj/LaunchScreen.storyboard"
    

提交回复
热议问题