{"id":1468,"date":"2023-07-31T18:40:13","date_gmt":"2023-07-31T10:40:13","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=1468"},"modified":"2023-07-31T18:40:13","modified_gmt":"2023-07-31T10:40:13","slug":"html5%e7%94%9f%e6%88%90app%e6%ba%90%e7%a0%81%e6%9c%89%e4%bb%80%e4%b9%88%e4%bd%9c%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/1468\/","title":{"rendered":"html5\u751f\u6210app\u6e90\u7801\u6709\u4ec0\u4e48\u4f5c\u7528?"},"content":{"rendered":"

HTML5\u751f\u6210APP\u6e90\u7801\u5173\u952e\u5728\u4e8e\u5c06\u7f51\u9875\u5185\u5bb9\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u6837\u7528\u6237\u53ef\u4ee5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u548c\u6846\u67b6\uff0c\u5982Apache Cordova\u3001PhoneGap\u6216React Native\u7b49\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecdHTML5\u751f\u6210APP\u7684\u539f\u7406\u548c\u5177\u4f53\u64cd\u4f5c\u6b65\u9aa4\u3002<\/p>\n

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

HTML5\u751f\u6210APP\u7684\u6838\u5fc3\u601d\u60f3\u662f\u5c06HTML\u3001CSS\u548cJavaScript\u7ed3\u5408\u5728\u4e00\u4e2a\u6c99\u7bb1\u73af\u5883\u4e2d\uff0c\u7136\u540e\u5c06\u5176\u8f6c\u6362\u6210\u539f\u751f\u7684\u79fb\u52a8\u5e94\u7528\u3002\u8fd9\u6837\u5c31\u53ef\u4ee5\u5229\u7528Web\u6280\u672f\u5f00\u53d1\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u76f4\u63a5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u8fd0\u884c\u5e76\u8bbf\u95ee\u539f\u751fAPI\u3002\u8fd9\u4e2a\u8fc7\u7a0b\u4e3b\u8981\u901a\u8fc7\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\u5b8c\u6210\uff1a<\/p>\n

1. \u5c06HTML\u3001CSS\u548cJavaScript\u4ee3\u7801\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/p>\n

2. \u5229\u7528WebView\u7ec4\u4ef6\u6e32\u67d3\u548c\u6267\u884c\u8fd9\u4e9bWeb\u8d44\u6e90\u3002<\/p>\n

3. \u4f7f\u7528\u4e00\u4e9b\u6865\u63a5\u6280\u672f\u548c\u5e93\uff0c\u4f7f\u5f97JavaScript\u80fd\u591f\u8c03\u7528\u672c\u5730\u8bbe\u5907API\uff0c\u5b9e\u73b0\u8bbe\u5907\u7279\u6027\u8bbf\u95ee\u3002<\/p>\n

4. \u628a\u8fd9\u4e9b\u529f\u80fd\u6574\u5408\u5728\u4e00\u8d77\uff0c\u6784\u5efa\u51fa\u9002\u7528\u4e8e\u5404\u4e2a\u5e73\u53f0\u7684APP\u3002<\/p>\n

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

\u5047\u8bbe\u6211\u4eec\u8981\u4f7f\u7528Apache Cordova\u4f5c\u4e3a\u5f00\u53d1\u6846\u67b6\uff0c\u90a3\u4e48HTML5\u751f\u6210APP\u6e90\u7801\u7684\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n

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

1. \u5b89\u88c5Node.js\uff0c\u786e\u4fddnpm\uff08Node.js\u7684\u5305\u7ba1\u7406\u5668\uff09\u53ef\u7528\u3002<\/p>\n

2. \u5b89\u88c5Apache Cordova\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u6267\u884c `npm install -g cordova`\u3002<\/p>\n

3. \u5982\u679c\u8981\u4e3a\u7279\u5b9a\u7684\u5e73\u53f0\uff08\u5982Android\u6216iOS\uff09\u6784\u5efaAPP\uff0c\u9700\u8981\u5b89\u88c5\u76f8\u5e94\u7684\u5e73\u53f0SDK\u3002<\/p>\n

\u4e8c\u3001\u521b\u5efa\u9879\u76ee\uff1a<\/p>\n

1. \u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u8f93\u5165 `cordova create MyA<\/p>\n

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

pp com.example\u5c01\u88c5app\u548c\u7f51\u9875\u751f\u6210<\/a>.myapp MyApp`\uff0c\u5176\u4e2d`MyApp`\u6307\u7684\u662f\u9879\u76ee\u6587\u4ef6\u5939\u540d\u79f0\uff0c`com.example.myapp`\u662fAPP\u7684\u552f\u4e00\u6807\u8bc6\u7b26\uff0c\u6700\u540e\u4e00\u4e2a`MyApp`\u662fAPP\u7684\u663e\u793a\u540d\u79f0\u3002<\/p>\n

2. \u5207\u6362\u5230\u9879\u76ee\u76ee\u5f55\uff0c\u6267\u884c`cd MyApp`\u3002<\/p>\n

3. \u6dfb\u52a0\u76ee\u6807\u5e73\u53f0\uff0c\u5982\uff1a`cordova platform add android`\uff08\u6b64\u65f6\u9700\u8981\u5df2\u7ecf\u5b89\u88c5Android SDK\uff09\u3002<\/p>\n

4. \u5728`www`\u6587\u4ef6\u5939\u4e2d\uff0c\u7f16\u5199HTML\u3001CSS\u548cJavaScript\u4ee3\u7801\u3002\u8fd9\u91cc\u662f\u4f60\u7684Web\u5e94\u7528\u7a0b\u5e8f\u7684\u6e90\u7801\u4f4d\u7f6e\u3002<\/p>\n

\u4e09\u3001\u6784\u5efaAPP\uff1a<\/p>\n

1. \u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u6267\u884c`cordova build`\uff0c\u8fd9\u5c06\u4e3a\u6240\u6709\u6dfb\u52a0\u7684\u5e73\u53f0\u521b\u5efa\u4e00\u4e2aAPP\u5305\u3002<\/p>\n

2. \u5982\u679c\u53ea\u60f3\u4e3a\u7279\u5b9a\u5e73\u53f0\u6784\u5efaAPP\uff0c\u53ef\u4ee5\u6267\u884c`cordova build android`\uff08\u4ee5\u751f\u6210Android APP\u4e3a\u4f8b\uff09\u3002<\/p>\n

\u56db\u3001\u6d4b\u8bd5APP\uff1a<\/p>\n

1. \u53ef\u4ee5\u5728\u6a21\u62df\u5668\u6216\u771f\u5b9e\u8bbe\u5907\u4e0a\u8fd0\u884cAPP\uff0c\u4f8b\u5982\uff0c\u6267\u884c`\u7f51\u9875app\u751f\u6210\u5668<\/a>cordova run android`\uff0c\u5c06\u5728\u8fde\u63a5\u7684Android\u8bbe\u5907\u6216\u6a21\u62df\u5668\u4e0a\u8fd0\u884c\u8be5\u5e94\u7528\u3002<\/p>\n

2. \u5bf9\u4e8e\u5176\u4ed6\u5e73\u53f0\uff0c\u8fd0\u884c\u547d\u4ee4\u7c7b\u4f3c\uff0c\u53ea\u9700\u5c06\u201candroid\u201d\u66ff\u6362\u6210\u5bf9\u5e94\u7684\u5e73\u53f0\u5373\u53ef\u3002<\/p>\n

\u4e94\u3001\u53d1\u5e03APP\uff1a<\/p>\n

1. \u6536\u96c6\u548c\u6574\u7406\u751f\u6210\u7684APP\u5305\uff0c\u4f8b\u5982\uff1aAndroid\u5e94\u7528\u7a0b\u5e8f\u4f1a\u751f\u6210APK\u6587\u4ef6\uff0c\u800ciOS\u5e94\u7528\u7a0b\u5e8f\u4f1a\u751f\u6210IPA\u6587\u4ef6\u3002<\/p>\n

2. \u6839\u636e\u76ee\u6807\u5e73\u53f0\u7684\u8981\u6c42\uff0c\u5c06\u751f\u6210\u7684APP\u63d0\u4ea4\u5230\u76f8\u5173\u5e94\u7528\u5546\u5e97\uff0c\u4f8b\u5982Google Play\uff08Android\uff09\u6216App Store\uff08iOS\uff09\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662fHTML5\u751f\u6210APP\u7684\u57fa\u672c\u539f\u7406\u548c\u8be6\u7ec6\u64cd\u4f5c\u6b65\u9aa4\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u6846\u67b6\u548c\u5de5\u5177\u53ef\u4ee5\u5b9e\u73b0\u7c7b\u4f3c\u7684\u76ee\u6807\uff0c\u4f8b\u5982PhoneGap\u548cReact Native\u3002\u4e0d\u540c\u7684\u6846\u67b6\u548c\u5de5\u5177\u4e4b\u95f4\uff0c\u64cd\u4f5c\u8fc7\u7a0b\u548c\u539f\u7406\u6709\u6240\u4e0d\u540c\uff0c\u4f46\u5e95\u5c42\u539f\u7406\u4ecd\u7136\u7c7b\u4f3c\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

HTML5\u751f\u6210APP\u6e90\u7801\u5173\u952e\u5728\u4e8e\u5c06\u7f51\u9875\u5185\u5bb9\u6253\u5305\u6210\u4e00\u4e2a\u72ec\u7acb\u7684\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u6837\u7528\u6237\u53ef\u4ee5\u5728\u79fb\u52a8\u8bbe\u5907\u4e0a\u5b89\u88c5\u548c\u4f7f\u7528\u3002\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u4e00\u4e9b\u5de5\u5177\u548c\u6846\u67b6\uff0c\u5982Apache Cordova\u3001PhoneGap\u6216R<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[3230,3229,80,12,56],"topic":[],"class_list":["post-1468","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-h5app","tag---app","tag-80","tag-12","tag-56"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1468","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=1468"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/1468\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=1468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=1468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=1468"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=1468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}