Skip to content

Source Map Upload

Automatic Source Map Packaging

Add Source Map Automatic Packaging Script

Script Tool: react-native-mobile-cli

react-native-mobile-cli is used to automatically fetch React Native and Native sourcemaps during release builds and package them into zip files.

Add it to the devDependencies in package.json using the local file method.

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

After adding, execute yarn install.

Note: For the Android environment, you need to add the Gradle Plugin configuration ft-plugin, version requirement >= 1.3.4.

Add the Plugin and parameter settings in the build.gradle file of the main module app:

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

Execute Configuration Command

Execute yarn ft-cli setup in the React Native project directory to enable automatic fetching of React Native and Native sourcemaps during release builds and packaging them into zip files.

  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.

Location of packaged zip files after release build:

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

Manual Source Map Packaging

React Native Zip Package Packaging Instructions

Upload

After generating the zip file, please upload the corresponding SourceMap file via the public network DataWay.

For more details, please refer to:

Android

iOS