{"id":1458,"date":"2023-07-31T18:40:22","date_gmt":"2023-07-31T10:40:22","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=1458"},"modified":"2023-07-31T18:40:22","modified_gmt":"2023-07-31T10:40:22","slug":"hbuilder%e6%80%8e%e4%b9%88%e7%94%a8%e7%bd%91%e9%a1%b5%e7%94%9f%e6%88%90app","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/1458\/","title":{"rendered":"hbuilder\u600e\u4e48\u7528\u7f51\u9875\u751f\u6210app?"},"content":{"rendered":"

HBuilder\u662f\u4e00\u6b3e\u4e13\u4e3aHTML5\u5f00\u53d1\u8005\u91cf\u8eab\u6253\u9020\u7684\u5f00\u53d1\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528HBuilder\uff0c\u7528\u6237\u53ef\u4ee5\u5c06HTML5\u7f51\u9875\u6216\u8005Hybrid\u5e94\u7528\uff08DCloud\u7684MUI\u6846\u67b6\uff09\u8f6c\u6362\u4e3a\u5b89\u5353\u6216iOS\u5e73<\/p>\n

<\/figure>\n<\/p>\n

\u53f0\u7684APP\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u8be6\u7ec6\u4ecb\u7ecd\u4e0b\u5982\u4f55\u4f7f\u7528HBuilder\u5c06\u7f51\u9875\u751f\u6210APP\u3002<\/p>\n

\u51c6\u5907\u5de5\u4f5c\uff1a<\/p>\n

1. \u4e0b\u8f7d\u548c\u5b89\u88c5HBuilder\uff1a\u8bbf\u95eeHBuilder\u5b98\u7f51\uff08http:\/\/www.dcloud.io\/\uff09\u4e0b\u8f7d\u5b89\u88c5\u5305\uff0c\u5e76\u6839\u636e\u5f00\u53d1\u5e73\u53f0\uff08Windows\u6216Mac\uff09\u9009\u62e9\u5bf9\u5e94\u7684\u5b89\u88c5\u5305\u8fdb\u884c\u5b89\u88c5\u3002<\/p>\n

2. App\u5f00\u53d1\u73af\u5883\u914d\u7f6e\uff1a\u6839\u636e\u6240\u9700\u5e73\u53f0\u9009\u62e9\uff0c\u914d\u7f6e\u76f8\u5173\u7684\u5f00\u53d1\u73af\u5883\uff0c\u6bd4\u5982Android Studio\u3001Xcode\u7b49\u3002<\/p>\n

3. \u5f00\u53d1\u51c6\u5907\uff1a\u51c6\u5907\u597d\u60a8\u8981\u751f\u6210APP\u7684app\u5728\u7ebf\u5305\u88c5\u751f\u6210<\/a>\u7f51\u9875\u8d44\u6e90\uff0c\u5305\u62ecHTML\u3001CSS\u3001JavaScript\u7b49\u3002<\/p>\n

\u64cd\u4f5c\u6b65\u9aa4\uff1a<\/p>\n

1. \u521b\u5efa\u9879\u76ee\uff1a\u6253\u5f00HBuilder\uff0c\u70b9\u51fb\u5de6\u4e0a\u89d2\u7684\u6587\u4ef6\u83dc\u5355\uff0c\u9009\u62e9\u201c\u65b0\u5efa\u201d-\u201c\u9879\u76ee\u201d\u3002\u9009\u62e9\u201c\u4ece\u6587\u672c\u5bfc\u5165\u201d\uff0c\u9009\u62e9\u60a8\u8981\u8f6c\u6362\u4e3aAPP\u7684\u7f51\u9875\u6587\u4ef6\u5939\uff0c\u70b9\u51fb\u786e\u5b9a\u3002<\/p>\n

2. \u914d\u7f6emanifest.json\u6587\u4ef6\uff1a\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u627e\u5230manifest.json\u6587\u4ef6\u3002\u6b64\u6587\u4ef6\u5305\u542b\u4e86\u9879\u76ee\u7684\u57fa\u672c\u4fe1\u606f\u548c\u6743\u9650\u914d\u7f6e\uff0c\u9700\u8981\u6839\u636e\u60a8\u7684\u9879\u76ee\u9700\u6c42\u8fdb\u884c\u914d\u7f6e\u3002<\/p>\n

\u4f8b\u5982\uff1a<\/p>\n

“`javascript<\/p>\n

{<\/p>\n

\t“id”: “your_app_id”,<\/p>\n

\t“name”: “your_app_name”,<\/p>\n

\t“version”: “1.0.0”,<\/p>\n

\t“description”: “your_app_description”,<\/p>\n

\t“icons”: [<\/p>\n

\t\t{<\/p>\n

\t\t\t“src”: “icon.png”<\/p>\n

\t\t}<\/p>\n

\t],<\/p>\n

\t“permissions”: [<\/p>\n

“ACCESS_NETWORK_STATE”,<\/p>\n

“ACCESS_WIFI_STATE”,<\/p>\n

“CHANGE_WIFI_STATE”,<\/p>\n

“INTERNET”<\/p>\n

]<\/p>\n

}<\/p>\n

“`<\/p>\n

3. \u914d\u7f6e\u9879\u76ee\uff1a\u914d\u7f6e\u597dmanifest.json\u6587\u4ef6\u540e\uff0c\u56de\u5230\u9879\u76ee\u7ed3\u6784\uff0c\u5728\u9879\u76ee\u5185\u90e8\u627e\u5230index.html\u6587\u4ef6\uff0c\u5e76\u786e\u8ba4\u6b64\u6587\u4ef6\u662f\u60a8\u7f51\u7ad9\u7684\u5165\u53e3\u6587\u4ef6\u3002<\/p>\n

4. \u751f\u6210APP\uff1a\u70b9\u51fb\u9876\u90e8\u83dc\u5355\u680f\u7684\u201c\u53d1\u884c\u201d\u9009\u9879\uff0c\u7136\u540e\u9009\u62e9\u201c\u539f\u751fAPP-\u4e91\u6253\u5305\u201d\u3002\u5728\u5f39\u7f51\u7ad9\u751f\u6210app\u7528\u4ec0\u4e48\u6700\u597d<\/a>\u51fa\u7684\u5bf9\u8bdd\u6846\u4e2d\uff0c\u9009\u62e9\u6240\u9700\u7684\u7f16\u8bd1\u5e73\u53f0\uff08Android\u6216iOS\uff09\uff0c\u7136\u540e\u70b9\u51fb\u201c\u6253\u5305\u201d\u3002<\/p>\n

5. \u4e0b\u8f7d\u751f\u6210\u7684APP\uff1a\u4e91\u6253\u5305\u5b8c\u6210\u540e\uff0c\u4f1a\u751f\u6210\u4e00\u4e2aAPP\u6587\u4ef6\uff0cHBuilder\u4f1a\u53d1\u9001\u4e0b\u8f7d\u94fe\u63a5\u5230\u60a8\u7684\u90ae\u7bb1\u3002\u60a8\u53ef\u4ee5\u4e0b\u8f7d\u8be5APP\u5e76\u5b89\u88c5\u5230\u5bf9\u5e94\u7684\u8bbe\u5907\u8fdb\u884c\u6d4b\u8bd5\u3002<\/p>\n

\u539f\u7406\uff1a<\/p>\n

HBuilder\u5c06\u7f51\u9875\u5e94\u7528\u7f16\u8bd1\u751f\u6210\u539f\u751fAPP\u7684\u539f\u7406\u662f\u57fa\u4e8eHybrid\u6280\u672f\uff0c\u5b83\u901a\u8fc7\u5c06HTML\u3001CSS\u3001JavaScript\u7b49\u6587\u4ef6\u6253\u5305\u5230APP\u5185\uff0c\u5e76\u5728APP\u4e2d\u5d4c\u5165\u4e86\u4e00\u4e2aWebView\u7ec4\u4ef6\u7528\u4e8e\u6e32\u67d3\u5c55\u793a\u8fd9\u4e9b\u9875\u9762\u3002\u5f53\u7528\u6237\u4f7f\u7528APP\u65f6\uff0c\u5b9e\u9645\u4e0a\u662f\u901a\u8fc7WebView\u8bbf\u95ee\u672c\u5730\u7684\u7f51\u9875\u3002\u8fd9\u4f7f\u5f97\u5f00\u53d1\u8005\u80fd\u591f\u4f7f\u7528\u719f\u6089\u7684HTML5\u6280\u672f\u5feb\u901f\u5f00\u53d1\u8de8\u5e73\u53f0\u7684APP\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528HBuilder\u5c06\u7f51\u9875\u751f\u6210APP\u7684\u8be6\u7ec6\u6559\u7a0b\u3002\u901a\u8fc7\u8fd9\u6837\u7684\u65b9\u6cd5\uff0c\u60a8\u53ef\u4ee5\u5c06\u719f\u6089\u7684HTML5\u6280\u672f\u5e94\u7528\u4e8eAPP\u5f00\u53d1\uff0c\u5b9e\u73b0\u8de8\u5e73\u53f0\u7684\u5f00\u53d1\u9700\u6c42\u3002\u8bf7\u6ce8\u610f\uff0c\u51fa\u4e8e\u5b89\u5168\u6027\u548c\u5e94\u7528\u5546\u5e97\u5ba1\u6838\u7684\u539f\u56e0\uff0c\u4e0d\u63a8\u8350\u5c06\u7eaf\u7f51\u7edc\u7f51\u9875\u5236\u4f5c\u4e3aAPP\u53d1\u5e03\u5230\u5e94\u7528\u5546\u5e97\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HBuilder\u662f\u4e00\u6b3e\u4e13\u4e3aHTML5\u5f00\u53d1\u8005\u91cf\u8eab\u6253\u9020\u7684\u5f00\u53d1\u5de5\u5177\u3002\u901a\u8fc7\u4f7f\u7528HBuilder\uff0c\u7528\u6237\u53ef\u4ee5\u5c06HTML5\u7f51\u9875\u6216\u8005Hybrid\u5e94\u7528\uff08DCloud\u7684MUI\u6846\u67b6\uff09\u8f6c\u6362\u4e3a\u5b89\u5353\u6216iOS\u5e73\u53f0\u7684APP\u3002\u63a5\u4e0b\u6765<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[3210,3209,16,149,23],"topic":[],"class_list":{"0":"post-1458","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-appkf","7":"tag-app","9":"tag-16","10":"tag-149","11":"tag-23"},"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1458","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=1458"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1458\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=1458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=1458"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=1458"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=1458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}