跳转至

符号文件上传

自动打包符号文件

添加符号文件自动打包脚本

脚本工具:react-native-mobile-cli

react-native-mobile-cli 用于在发布构建时自动获取 React Native 和 Native sourcemaps,并将它们打包为 zip 文件。

使用本地文件方式将其添加到 package.json 的开发依赖中。

"devDependencies": {
  "@cloudcare/react-native-mobile-cli":"file:./ft-react-native-mobile-cli-v1.0.0.tgz"
}

添加后执行 yarn install

注意:安卓环境需要添加配置 Gradle Plugin ft-plugin,版本要求 >= 1.3.4

在项目主模块 appbuild.gradle 文件中添加 Plugin 与参数设置:

apply plugin: 'ft-plugin'
FTExt {
    //showLog = true
    autoUploadMap = true
    autoUploadNativeDebugSymbol = true
    generateSourceMapOnly = true
}

执行配置命令

在 React Native 项目目录下执行 yarn ft-cli setup,使其能够在发布构建时自动获取 React Native 和 Native sourcemaps,并将它们打包为 zip 文件。

  example git:(test-cli)  yarn ft-cli setup
yarn run v1.22.22
$ /Users/xxx/example/node_modules/.bin/ft-cli setup
Starting command: Setup to automatically get react-native and native sourcemap in release build and package them as zip files.
Running task: Add a Gradle Script to automatically zip js sourcemap and Android symbols
Running task: Enable react-native sourcemap generation on iOS
Running task: Setup a new build phase in XCode to automatically zip dSYMs files and js sourcemap


Finished running command Setup to automatically get react-native and native sourcemap in release build and package them as zip files.

 Successfully executed: Add a Gradle Script to automatically zip js sourcemap and Android symbols.
 Successfully executed: Enable react-native sourcemap generation on iOS.
 Successfully executed: Setup a new build phase in XCode to automatically zip dSYMs files and js sourcemap.
  Done in 1.00s.

进行 release build 后打包的 zip 文件地址:

  • iOS:./ios/sourcemap.zip
  • Android:./sourcemap.zip

手动打包符号文件

React Native Zip 包打包说明

上传

生成 zip 文件后,请通过公网 DataWay 上传对应的 SourceMap 文件。

更多详情,可查看:

发布包相关配置

Android

iOS

文档评价

文档内容是否对您有帮助? ×