标签:sse 打包apk andriod build start adb too https key
官方入门教程:https://reactnative.cn/docs/0.51/getting-started.html
http://services.gradle.org/distributions/
1.安装好java sdk,andriod sdk,android studio。
2.配置环境变量。
3.下载一个gradle,并修改为本地离线下载
4.react-native run-android
调试
adb connect 127.0.0.1:62001
react-native run-android
-genkey
-alias tomcat(别名)
-keypass 123456(别名密码)
-keyalg RSA(算法)
-keysize 1024(密钥长度)
-validity 365(有效期,天单位)
-keystore D:/keys/tomcat.keystore(指定生成证书的位置和证书名称)
-storepass 123456(获取keystore信息的密码)
用keytool生成一个签名密钥
keytool -genkey -alias my-release-key -keypass 2009 -keyalg RSA -keysize 2048 -validity 365 -keystore D:/keys/my-release-key.keystore -storepass 2009
添加签名到项目的gradle配置文件
android {
...
defaultConfig { ... }
signingConfigs {
release {
storeFile file("my-release-key.keystore")
storePassword "密码"
keyAlias "keyAlias的名字"
keyPassword "密码"
}
}
buildTypes {
release {
...
signingConfig signingConfigs.release
}
}
}
打包
React-native bundle --entry-file index.js --bundle-output ./android/app/src/main/assets/index.android.jsbundle --platform android --assets-dest ./android/app/src/main/res/ --dev false
打包apk文件
gradlew assembleRelease
标签:sse 打包apk andriod build start adb too https key
原文地址:https://www.cnblogs.com/souleigh-hong/p/9047214.html