Last active
August 9, 2019 07:08
-
-
Save Matrixbirds/1448de485484031cdb9dd1c92c9e8ec7 to your computer and use it in GitHub Desktop.
react-native
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 分析客户提供的apk | |
# 检查apk里是否包含bundlejs的文件 | |
apkanalyzer files list app/build/outputs/apk/release/app-release.apk | grep bundle | |
# 检查apk里包含的so库 | |
apkanalyzer files list app/build/outputs/apk/release/app-release.apk | grep lib | |
# 列出apk里的全部文件 | |
apkanalyzer files list app/build/outputs/apk/release/app-release.apk |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rn android开发环境运行 | |
npm install | |
npm start -- --reset-cache # start react native package server | |
react-native run-android | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rn android环境打包apk | |
# ----------------------- | |
# - 1. 发布之前需要准备签名环境,请按照sign-for-release.sh步骤一步步完成 | |
# - 2. 需要先编译js文件 | |
# - 3. 再编译android依赖 | |
# ----------------------- | |
# bundle js file | |
react-native bundle --entry-file index.js \ | |
--bundle-output android/app/build/generated/assets/react/release/index.android.bundle \ | |
--platform android \ | |
--assets-dest android/app/src/main/res \ | |
--dev false | |
# build native | |
cd android; ./gradlew assembleRelease |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 发布前需要做签名 | |
vim android/app/build.gradle | |
# 在android/app/build.gradle加入以下代码 | |
# project.ext.react = [ | |
# bundleInDebug: false, | |
# bundleInRelease: true, | |
# root: '../../', | |
# entryFile: "index.js" | |
# ] | |
# keystore建议放在android/app目录里 | |
keytool -genkey -v -keystore android/app/android-app.keystore -alias appkey -keyalg RSA -keysize 2048 -validity 10000 | |
# 修改android/gradle.properties | |
MYAPP_RELEASE_STORE_FILE=android-app.keystore | |
MYAPP_RELEASE_KEY_ALIAS=appkey | |
MYAPP_RELEASE_STORE_PASSWORD=你生成keystore用的密码 # 建议临时打包时用同一个密码 方便记忆 | |
MYAPP_RELEASE_KEY_PASSWORD=你生成key用的密码 # 建议临时打包时用同一个密码 方便记忆 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment