1. Resource preparation
Download SDK
Website: https://nativesupport.dcloud.net.cn/AppDocs/download/android
Download Android Studio
Website: https:// nativesupport.dcloud.net.cn/UniMPDocs/SDKDownload/android
Appkey application
keytool -genkey -alias citysmart -keyalg RSA -keysize 2048 -validity 36500 -keystore citysmart.keystore 或者 keytool -genkey -alias citysmart -keystore citysmart.keystore
keytool -list -v -keystore citysmart.keystore
## 2. Pack local resourcesPack the local resources of the uni-app project, release----native App-local packaging----generate local packaged App resources, which will be in the project directory Generate the "unpackage" directory as shown in the figure below
3. Import the SDK project
Modify the build.gradle file under the app
signingConfigs { config { keyAlias 'citysmart' keyPassword '111111' storeFile file('citysmart.keystore') storePassword '111111' v1SigningEnabled true v2SigningEnabled true } } //keyAlias:生成证书时的别名;storeFile file:证书名全程,建议放在app项目下 applicationId "com.zhlj.citysmart" //applicationId:个人中心填写的包名
//value:个人中心生成的Appkey值 //package:包名为个人中心填写的包名称
//main\assets\data\dcloud_control.xml文件中//appid:HBuilder中的appid
In Click Build----Generate Signed Bundle/APK in the menu bar of Android Studio, as shown in the picture below. After opening, select APK, next
## 3. Select the debug or release version, finish to complete the packaging, see the picture below
4. Release installation package storage path
The packaged APK is stored in the release folder under the APP, as shown in the figure belowThe above is the detailed content of uni-app offline packaging tutorial. For more information, please follow other related articles on the PHP Chinese website!