search
HomeWeb Front-enduni-appuni-app offline packaging tutorial


1. Resource preparation

  1. Download SDK

    Website: https://nativesupport.dcloud.net.cn/AppDocs/download/android

  2. Download Android Studio

    Website: https:// nativesupport.dcloud.net.cn/UniMPDocs/SDKDownload/android

  3. Appkey application

##                                 Starting from version 3.1.10, you need to apply for Appkey

Tutorial: https://nativesupport.dcloud.net.cn/AppDocs/usesdk/appkey

Website: https://dev.dcloud.net.cn/app/index

cmd command

Generate certificate:


keytool -genkey -alias citysmart -keyalg RSA -keysize 2048 -validity 36500 -keystore citysmart.keystore
或者
keytool -genkey -alias citysmart -keystore citysmart.keystore

Query the certificate, see the picture below

keytool -list -v -keystore citysmart.keystore

uni-app offline packaging tutorial

## 2. Pack local resources Pack 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

uni-app offline packaging tutorial

3. Import the SDK project

    Unzip and download the corresponding version of the SDK, which contains a native App project, as shown in the picture below
  1. uni-app offline packaging tutorial

    ##HBuilder-Integrate in the SDK -AS\simpleDemo\src\main\assets\apps__UNI__A's folder is packaged with uni-app unpackage----resources---- -UNI-*** folder and replaced
  2. Use Android Studio to open the HBuilder-Integrate-AS project
4. Modify the AS project configuration file

Modify the build.gradle file under the app
  1. 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:个人中心填写的包名

    2. Modify the AndroidManifest.xml file
  2. <meta-data
        android:name="dcloud_appkey"
        android:value="8285e65623ea464774523522d957e6bb" />
    //value:个人中心生成的Appkey值
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.zhlj.citysmart">
    //package:包名为个人中心填写的包名称
3. Modify the control.xml file

//main\assets\data\dcloud_control.xml文件中
<hbuilder>
<apps>
    <app appid="__UNI__6FE3F0B" appver=""/>
</apps>
</hbuilder>
//appid:HBuilder中的appid

4. Set the App name and icon by yourself

5. AS packaging

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
## 2. Fill in the generated .keystore certificate, password and alias, Next, see the picture below

uni-app offline packaging tutorial

## 3. Select the debug or release version, finish to complete the packaging, see the picture below

uni-app offline packaging tutorial

4. Release installation package storage path

uni-app offline packaging tutorial

The packaged APK is stored in the release folder under the APP, as shown in the figure below

uni-app offline packaging tutorial

The above is the detailed content of uni-app offline packaging tutorial. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
VSCode中如何开发uni-app?(教程分享)VSCode中如何开发uni-app?(教程分享)May 13, 2022 pm 08:11 PM

VSCode中如何开发uni-app?下面本篇文章给大家分享一下VSCode中开发uni-app的教程,这可能是最好、最详细的教程了。快来看看!

利用uniapp开发一个简单的地图导航利用uniapp开发一个简单的地图导航Jun 09, 2022 pm 07:46 PM

怎么利用uniapp开发一个简单的地图导航?本篇文章就来为大家提供一个制作简单地图的思路,希望对大家有所帮助!

聊聊如何利用uniapp开发一个贪吃蛇小游戏!聊聊如何利用uniapp开发一个贪吃蛇小游戏!May 20, 2022 pm 07:56 PM

如何利用uniapp开发一个贪吃蛇小游戏?下面本篇文章就手把手带大家在uniapp中实现贪吃蛇小游戏,希望对大家有所帮助!

uni-app vue3接口请求怎么封装uni-app vue3接口请求怎么封装May 11, 2023 pm 07:28 PM

uni-app接口,全局方法封装1.在根目录创建一个api文件,在api文件夹中创建api.js,baseUrl.js和http.js文件2.baseUrl.js文件代码exportdefault"https://XXXX.test03.qcw800.com/api/"3.http.js文件代码exportfunctionhttps(opts,data){lethttpDefaultOpts={url:opts.url,data:data,method:opts.method

实例讲解uniapp实现多选框的全选功能实例讲解uniapp实现多选框的全选功能Jun 22, 2022 am 11:57 AM

本篇文章给大家带来了关于uniapp的相关知识,其中主要整理了实现多选框的全选功能的相关问题,无法实现全选的原因是动态修改checkbox的checked字段时,界面上的状态能够实时变化,但是无法触发checkbox-group的change事件,下面一起来看一下,希望对大家有帮助。

手把手带你开发一个uni-app日历插件(并发布)手把手带你开发一个uni-app日历插件(并发布)Jun 30, 2022 pm 08:13 PM

本篇文章手把手带大家开发一个uni-app日历插件,介绍下一款日历插件是如何从开发到发布的,希望对大家有所帮助!

实例详解uniapp如何实现电话录音功能(附代码)实例详解uniapp如何实现电话录音功能(附代码)Jan 05, 2023 pm 04:41 PM

本篇文章给大家带来了关于uniapp的相关知识,其中主要介绍了怎么用uniapp实现拨打电话并且还能同步录音的功能,感兴趣的朋友一起来看一下吧,希望对大家有帮助。

聊聊使用Uniapp怎么实现全局消息提示及其组件聊聊使用Uniapp怎么实现全局消息提示及其组件Jun 22, 2022 pm 06:24 PM

Uniapp中怎么实现全局消息提示及其组件?下面本篇文章给大家介绍一下Uniapp全局消息提示及其组件的实现方法,希望对大家有所帮助!

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft