シンボルファイルのアップロード¶
シンボルファイルの自動パッケージ化¶
シンボルファイル自動パッケージ化スクリプトの追加¶
スクリプトツール: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 を実行します。
注意:Android 環境では、Gradle Plugin ft-plugin を追加設定する必要があります。バージョン
>= 1.3.4が必須です。
プロジェクトのメインモジュール app の build.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.
リリースビルド後にパッケージ化される zip ファイルのパス:
- iOS:
./ios/sourcemap.zip - Android:
./sourcemap.zip
シンボルファイルの手動パッケージ化¶
React Native Zip パッケージのパッケージ化手順
アップロード¶
zip ファイルを生成した後、パブリックネットワークの DataWay を使用して対応する SourceMap ファイルをアップロードしてください。
詳細については、以下を参照してください。