uni-app development android application process

uni-app development android details

1. Download and install hbuilder and android studio

  1. uni-app official website: uni-app official website
  2. hbuilder download address: HBuilderX Documentation
  3. android studio download link: Download Android Studio & App Tools - Android Developers

Description: hbuilder is mainly used to generate local packaging files, android studio is mainly used to install apps and generate software installation packages.

2. Register a uni-app account and log in to the developer center

  1. Account registration login address: Developer Center

Note: This account is mainly used to generate appID and Android appkey, and is also used to generate packaging certificates. You need to log in to the account you applied for in the hbuilder development tool.

3. Configure project appid and appkey

  1. Log in to the uni-app developer center, fill in relevant information, and generate appid and appkey

        

 

       2. Open hbuilder and log in to the applied developer account. Find the mainfest.json file in the project and open it, fill in the corresponding appid, and you can get it directly by connecting to the Internet.

 

 

Four, hbuilder generates local offline file process

  1. Select the project and click: Release -> Native APP Local Packaging -> Generate Local Packaging APP Resources.

Wait for the project to be edited (if it is a project just cloned from gitlab, you need to run npm install first, if you run npm run dev:h5, it can be opened in the browser, indicating that the project can run normally, and local packaged resources can be generated)

 

 

         2. At this point, use hubilder to generate local APP resources and complete

5. Android studio configures the local APP resources generated by uni-app

  1. Download the latest APP offline SDK from uni-app official website, address: https://nativesupport.dcloud.net.cn/AppDocs/usesdk/android https://nativesupport.dcloud.net.cn/AppDocs/usesdk/android
  2.  Unzip the downloaded SDK, and use android studio to open the HBuilder-Integrate-AS project in the directory. The downloaded SDK mainly uses this directory. You can copy this directory to the workspace, and delete the others. (Before opening the project with android studio, it is best to create a helloworld demo with android studio to ensure that android studio can be used normally)

     3. Modify the configuration, modify the application icon and name

      4. Modify the appkey, find the AndroidMainfest.xml in the project, and modify the appkey at the bottom. The appkey here is the appkey generated on the uni-app developer center

 

 

 

    5. To replace the local packaged app resources, copy the local APP packaged resources generated by hbuilder to the apps directory of the project. simpleDemo -> src -> main -> assets -> apps

 

  

     6. Modify the configuration corresponding to appid, set debug     debug = "true" syncDebug = "true"

With this sentence, you can see the console.log log of the html page in the android studio console, which is mainly used for debugging

     7. Generate android certificate signature: You can log in to the uni-app developer platform to view related documents.

Android Platform Signing Certificate (.keystore) Generation Guide - DCloud Answers

 

 

     8. Generate .jks file, please refer to the article: Android Studio generates .jks file_m1m-FG's blog-CSDN blog_android jks

     9. Replace the .jks file, replace the test.jks in the project with the .jks file generated by yourself

        

  

6. Run the app

        1. Click Device Management

 

        2. Create a device

 

 3. Select a device, click next, and generate a simulator 

4. The last step: run 

 

Guess you like

Origin blog.csdn.net/xishaoguo/article/details/127653932