How to package an H5 project into an APP

HBuilderX, an editor for developing uni-apps, can package H5 projects into APPs. I believe many friends don't know this function yet. The following will introduce how to package H5 into APP.

HBuilderX download link: https://www.dcloud.io/hbuilderx.html

1. Create a new 5+APP project

Select File>New>Project, create a new 5+APP project, select the default template, fill in the project name and address, and click Create.

2. Delete unnecessary files

Delete all files except manifest.json, in fact, these are H5 files, we must use our own

Only keep the manifest.json file

3. Copy the H5 packaged file to the current directory

That is, npm run build copies all the files under the dist file generated by packaging our project.

4. Configure APP

Click the manifest.json file, here we can configure the application logo, application name, icon configuration, etc., and configure them one by one according to our own needs.

icon configuration

5. Distribution - cloud packaging

Release-native APP-cloud packaging

Since you are debugging by yourself, you can select the public test certificate, and then click Package. Note that a real-name authentication account is required for the first packaging, which can be done under the DCloud official website authentication login authentication.

6. Install apk

It takes about 2-5 minutes to package, open the local directory to find the corresponding apk, send it to the mobile phone and install it.

Install on Android phone

After opening, the effect is the same as that of H5

ok, the Android APK is complete. Although I don't quite understand the principle, I guess it is implemented by adding a WebView to the native Android shell.

Since IOS cannot use public certificates, it can only apply for certificates, so it will not be demonstrated here.

Guess you like

Origin blog.csdn.net/dxhheath/article/details/128927072