A moving step of development App
Installation HBuilder
Address: https: //www.dcloud.io/hbuilderx.html
Standard Edition: it is directly used for web development, markdown, word processing scene. App do still need to install plug-ins
-
App Development Board: on the basis of the standard version of the preset desired App / uni-app development plug, out of the box
If the recommendation is to develop App App Developer Edition can download and install.
Create a project
Step participate in projects
1, choose to participate in the project 5 + App (A)
Set 2 storage directory name, as well as projects, and projects
3, the template project temporarily can select the default template
Description of the project directory structure
1, CSS `: style file storage project resources
2, img : image files stored project resources
3, JS JS file resource storage project:
4, unpackages `: storing unneeded files packaged resources
5 index.html
: Project Home
6, manifest.json : App package configuration file
On-device debugging
That is to run to the phone to debug page preview
Android phones
Common problems:
1, HBuilderX real machine running, the phone runs a real machine FBI FAQ:
https://ask.dcloud.net.cn/article/97
2, it is recommended to download and install 360 mobile assistant, if the assistant phone 360 can be connected to the phone, basically on OK
Steps:
1 open developer options open in your phone's settings
2. Enable USB debugging and developer options
3, using the data cable phone and computer connections
4, and then HBuilder software, select the Run menu to run to the phone or emulator, you can find their phone inside.
5, after running the device, Hbuilder the console automatically opens and outputs a running log
6, then Hbuilder require installation base (applied) to the phone, this time the phone will prompt you to allow installation of the application, you can choose to allow
7, after the commissioning of the base installed, Hbuilder will automatically open and run the project this App.
IOS mobile phone
1, download and install iTunes
2, the data line is connected to the computer using
3, to ensure normal iTunes can connect to the phone
4. Select Hbuilder software to run on your iPhone device
5, it will be installed in the phone for debugging test App: Hbuilder
6, set Hbuilder trusted developers on the phone
HTML + API access
1, various API can be called by phone js
2, HTML + API: Documentation Address
Packaged and released
1, the configuration manifest.json file, select the function they need to add configuration
2, found in HBuilder software: Release Native APP (cloud package)
3, wait a while to get the results package installation package, then installed on the mobile phone testing, installation package installation address will appear on the console
4, Last post corresponding to mobile application store as needed
Description: The project files are packaged into the application installation package, as long as the requests do not need to install this application download these files, unless some request interface functions must be networked. In this way the benefits of networking are some of the core files do not need to download, but the update trouble, if you modify the code, you need to repack.
There is another way, we deploy the application for the site, and then load our website that applied in this case children inside.
If the test is developed, then the manifest.json
file is lanuchpath
modified to your LAN address.
If the release is deployed, it will luanchpath
address line settings
Use Vue.js develop HTML5 + APP
1, in the vue start the server, the configuration server in the local address to the manifest.json 文件中的
lanuchpath in
2, and then run to the phone in the software to
Packaged and released
1, app/manifest.json
the launch_path
read line address
2, loaded HBuilder in item (created) heads the app directory, the directory can be as long as a manifest.json file, which configure the machine address of the server is started, and then choose the software, the menu bar → issued → native App cloud package
3, equipped with packaging rules, waiting for the results of packing
4, if necessary, issue to the phone application store for users to download (Android installation packages directly into their server for users to download)
Caching Issues
1, mobile phone App pages in the cache may be a problem, the solution is: Combining the front + back-end cache disabled.
2, the reference address: https: //ask.dcloud.net.cn/question/31327
About deployment
/**
- Configuration files: HTTPS: //cli.vuejs.org/zh/config/
* /
module.exports = {
/**
-
/ Deployed in HTTP for service
-
If mixing is applied, it is set to a relative path ./
-
Reference document: HTTPS: //cli.vuejs.org/zh/config/#publicpath
* /
publicPath: "./",devServer: { // host: '和手机在一个网段的网卡地址' }
};