{"id":9544,"date":"2023-11-23T15:31:54","date_gmt":"2023-11-23T07:31:54","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=9544"},"modified":"2023-11-23T15:31:54","modified_gmt":"2023-11-23T07:31:54","slug":"%e7%a7%bb%e5%8a%a8%e7%ab%af%e9%a1%b9%e7%9b%ae%e6%89%93%e5%8c%85%e6%88%90app%e6%93%8d%e4%bd%9c%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/9544\/","title":{"rendered":"\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210app\u64cd\u4f5c\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"
\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP<\/p>\n \u968f\u7740\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u666e\u53ca\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u7528\u6237\u548c\u4f01\u4e1a\u9700\u8981\u628a\u79fb\u52a8\u7aef\u7f51\u7ad9\u6216Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u539f\u751fAPP\u3002\u539f\u751fAPP\u5177\u6709\u65e0\u9700\u6d4f\u89c8\u5668\u8bbf\u95ee\u3001\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3001\u66f4\u597d\u7684\u7cfb\u7edf\u8d44\u6e90\u5229\u7528\u3001\u4ee5\u53ca\u66f4\u65b9\u4fbf\u5730\u5728\u5e94\u7528\u5546\u5e97\u63a8\u5e7f\u7b49\u4f18\u52bf\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u539f\u7406\u4ee5\u53ca\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n \u4e00\u3001\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u539f\u7406<\/p>\n \u8981\u7406\u89e3\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u539f\u7406\uff0c\u9996\u5148\u9700\u8981\u4e86\u89e3\u4e24\u4e2a\u6982\u5ff5\uff1a\u539f\u751fAPP\u548c\u6df7\u5408APP\u3002\u539f\u751fAPP\u662f\u9488\u5bf9\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\uff08\u5982iOS\u6216Android\uff09\u4f7f\u7528\u7279\u5b9a\u7f16\u7a0b\u8bed\u8a00\uff08\u5982Objective-C\u6216Java\uff09\u7f16\u5199\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u539f\u751fAPP\u53ef\u4ee5\u5145\u5206\u5229\u7528\u64cd\u4f5c\u7cfb\u7edf\u5305\u62ec\u786c\u4ef6\u548cAPI\u7684\u4f18\u52bf\uff0c\u5b9e\u73b0\u66f4\u597d\u7684\u6027\u80fd\u548c\u7528\u6237\u4f53\u9a8c\u3002\u800c\u6df7\u5408APP\u5219\u662f\u901a\u8fc7\u5c06Web\u6280\u672f\uff08HTML\u3001CSS\u548cJavaScript\uff09\u4e0e\u539f\u751f\u5e94\u7528\u7a0b\u5e8f\u7ed3\u5408\u7684\u65b9\u5f0f\uff0c\u5b9e\u73b0\u8de8\u5e73\u53f0\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n \u90a3\u4e48\u79fb\u52a8\u7aef\u9879\u76ee\u5982\u4f55\u6253\u5305\u6210APP\u5462\uff1f\u4e3b\u8981\u901a\u8fc7\u4ee5\u4e0b\u4e24\u79cd\u65b9\u5f0f\uff1a<\/p>\n 1. WebView\u5bb9\u5668<\/p>\n WebView\u5bb9\u5668\u662f\u4e00\u79cd\u4f7f\u7528\u539f\u751f\u4ee3\u7801\u521b\u5efa\u7684\u7ec4\u4ef6\uff0c\u7528\u4e8e\u5c55\u793a\u7f51\u9875\u5185\u5bb9\u3002\u901a\u8fc7\u5d4c\u5957\u4e00\u4e2aWebView\u7ec4\u4ef6\u5230\u539f\u751fAPP\u4e2d\uff0c\u53ef\u5b9e\u73b0\u5c06\u79fb\u52a8\u7aef\u7f51\u7ad9\u6216Web\u5e94\u7528\u7a0b\u5e8f\u5448\u73b0\u7ed9\u7528\u6237\u3002WebView\u53ef\u4ee5\u8c03\u7528\u8bbe\u5907\u7684\u786c\u4ef6\u8d44\u6e90\u548cAPI\uff0c\u5b9e\u73b0\u5728Web\u6280\u672f\u4e0a\u65e0\u6cd5\u8fbe\u5230\u7684\u5c5e\u6027\u3002\u5e38\u89c1\u7684WebView\u5bb9\u5668\u6709Android\u7684WebView\u548ciOS\u7684UIWebView\u3002<\/p>\n 2. \u5f00\u6e90\u7684\u6df7\u5408APP\u6846\u67b6<\/p>\n \u8bb8\u591a\u5f00\u6e90\u7684\u6df7\u5408APP\u6846\u67b6\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u66f4\u5bb9\u6613\u5730\u5c06\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u3002\u8fd9\u4e9b\u6846\u67b6\u63d0\u4f9b\u4e86\u4e00\u7cfb\u5217\u7684API\u4ee5\u53ca\u5bf9\u539f\u751f\u4ee3\u7801\u7684\u5c01\u88c5\uff0c\u4f7f\u5f97\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7684\u7f51\u9875\u4e0d\u4ec5\u53ef\u4ee5\u5728\u6d4f\u89c8\u5668\u4e2d\u8bbf\u95ee\uff0c\u8fd8\u53ef\u4ee5\u50cf\u539f\u751fAPP\u4e00\u6837\u5728\u4e0d\u540c\u7684\u8bbe\u5907\u548c\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u3002\u5e38\u89c1\u7684\u6df7\u5408APP\u6846\u67b6\u6709Cordova\/PhoneGap\u3001React Native\u3001Ionic\u3001Flutter\u7b49\u3002<\/p>\n \u4e8c\u3001\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u8be6\u7ec6\u6b65\u9aa4<\/p>\n \u4ee5\u4e0b\u4ee5Cordova\u4e3a\u4f8b\uff0c\u4ecb\u7ecd\u5982\u4f55\u5c06\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n 1. \u5b89\u88c5\u73af\u5883\u51c6\u5907<\/p>\n \u5b89\u88c5Node.js\u8fdb\u884c\u6784\u5efa\uff0c\u5b89\u88c5Cordova\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5e76\u914d\u7f6e\u597dAndroid\u548ciOS\u7684SDK\u4ee5\u53ca\u5f00\u53d1\u73af\u5883\u3002<\/p>\n 2. \u521b\u5efaCordova\u9879\u76ee<\/p>\n \u5728\u547d\u4ee4\u884c\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u521b\u5efa\u4e00\u4e2aCordova\u9879\u76ee\uff1a<\/p>\n cordova create MyApp<\/p>\n \u8fd9\u5c06\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\u201cMyApp\u201d\u7684\u76ee\u5f55\uff0c\u5176\u4e2d\u5305\u62ec\u4e86\u9879\u76ee\u6e90\u6587\u4ef6\u4ee5\u53ca\u7f16\u8bd1\u548c\u6253\u5305\u6240\u9700\u7684\u811a\u672c\u3002<\/p>\n 3. \u6dfb\u52a0\u5e73\u53f0<\/p>\n \u8fdb\u5165\u9879\u76ee\u76ee\u5f55\u540e\uff0c\u6dfb\u52a0\u8981\u6253\u5305\u7684\u5e73\u53f0\uff0c\u4f8b\u5982\uff1a<\/p>\n cordova platform add android<\/p>\n cordova platform add ios<\/p>\n \u8fd9\u5c06\u4e3a\u9879\u76ee\u6dfb\u52a0Android\u548ciOS\u5e73\u53f0\u7684\u652f\u6301\uff0c\u5305\u62ec\u5bf9\u5e94\u7684\u539f\u751f\u4ee3\u7801\u548c\u8d44\u6e90\u3002<\/p>\n 4. \u914d\u7f6e\u9879\u76ee<\/p>\n \u6253\u5f00\u9879\u76ee\u76ee\u5f55\u4e0b\u7684www\u76ee\u5f55\uff0c\u5c06\u79fb\u52a8\u7aef\u9879\u76ee\u7684HTML\u3001CSS\u548cJavaScript\u6587\u4ef6\u653e\u5165\u3002\u5982\u679c\u6709\u9700\u8981\uff0c\u53ef\u4ee5\u4fee\u6539config.xml\u6587\u4ef6\uff0c\u914d\u7f6e\u9879\u76ee\u7684\u5143\u6570\u636e\uff08\u5982APP\u540d\u79f0\u3001\u4f5c\u8005\u3001\u4e3b\u9875\u7b49\uff09\u4ee5\u53ca\u76f8\u5173\u63d2\u4ef6\u3002<\/p>\n 5. \u52a0\u5165Cordova\u63d2\u4ef6<\/p>\n \u4e3a\u4e86\u8ba9\u4f60\u7684\u79fb\u52a8\u7aef\u9879\u76ee\u80fd\u8c03\u7528\u539f\u751fAPI\uff0c\u53ef\u4ee5\u901a\u8fc7\u6dfb\u52a0Cordova\u63d2\u4ef6\u6765\u5b9e\u73b0\u3002\u4f8b\u5982\uff1a<\/p>\n cordova plugin add cordova-plugin-camera<\/p>\n \u4e0a\u8ff0\u547d\u4ee4\u5c06\u4e3a\u9879\u76ee\u6dfb\u52a0\u7167\u76f8\u673a\u63d2\u4ef6\uff0c\u4f7f\u9879\u76ee\u80fd\u8c03\u7528\u8bbe\u5907\u7684\u6444\u50cf\u5934\u3002<\/p>\n 6. \u7f16\u8bd1\u6253\u5305<\/p>\n \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u5c06\u9879\u76ee\u7f16\u8bd1\u5e76\u6253\u5305\u6210\u5bf9\u5e94\u5e73\u53f0\u7684APP\u6587\u4ef6\uff1a<\/p>\n ciosapp\u5c01\u5305<\/a>ordova build android<\/p>\n cordova build ios<\/p>\n \u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u7684\u201cplatforms\/android\u201d\u548c\u201cplatforms\/ios\u201d\u6587\u4ef6\u5939\u5185\u5206\u522b\u627e\u5230\u751f\u6210\u7684APK\u6587\u4ef6\u548ciOS\u9879\u76ee\u3002<\/p>\n 7. \u6d4b\u8bd5\u548c\u53d1\u5e03<\/p>\n \u5c06\u751f\u6210\u7684APK\u6587\u4ef6\u5b89\u88c5\u5230Android\u8bbe\u5907\u4e0a\uff0c\u6216\u8005\u5c06iOS\u9879\u76ee\u5728Xcode\u4e2d\u6253\u5f00\u5e76\u8fd0\u884c\u5728iOS\u8bbe\u5907\u4e0a\uff0c\u8fdb\u884c\u6d4b\u8bd5\u548c\u4f18\u5316\u3002\u6d4b\u8bd5\u901a\u8fc7\u540e\uff0c\u4f60\u7684\u79fb\u52a8\u7aef\u9879\u76ee\u5df2\u7ecf\u6210\u529f\u6253\u5305\u6210\u4e00\u952eapp\u5c01\u88c5<\/a>\u4e86APP\uff0c\u53ef\u4ee5\u63d0\u4ea4\u5230Google Play\u548cApple App Store\u8fdb\u884c\u53d1\u5e03\u3002<\/p>\n \u603b\u7ed3<\/p>\n \u672c\u6587\u4ecb\u7ecd\u4e86\u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\uff0c\u5305\u62ec\u4f7f\u7528WebView\u5bb9\u5668\u548c\u5f00\u6e90\u7684\u6df7\u5408APP\u6846\u67b6\u5982Cordova\u5b9e\u73b0\u6253\u5305\u3002\u901a\u8fc7\u8fd9\u4e9b\u6280\u672f\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u5229\u7528Web\u6280\u672f\u66f4\u5bb9\u6613\u5730\u6784\u5efa\u8de8\u5e73\u53f0\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\uff0c\u63d0\u9ad8\u7528\u6237\u4f53\u9a8c\u548c\u4e92\u8054\u7f51\u666e\u53ca\u3002<\/p>\n","protected":false},"excerpt":{"rendered":" \u79fb\u52a8\u7aef\u9879\u76ee\u6253\u5305\u6210APP\u968f\u7740\u79fb\u52a8\u4e92\u8054\u7f51\u7684\u666e\u53ca\uff0c\u8d8a\u6765\u8d8a\u591a\u7684\u7528\u6237\u548c\u4f01\u4e1a\u9700\u8981\u628a\u79fb\u52a8\u7aef\u7f51\u7ad9\u6216Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u6210\u4e00\u4e2a\u539f\u751fAPP\u3002\u539f\u751fAPP\u5177\u6709\u65e0\u9700\u6d4f\u89c8\u5668\u8bbf\u95ee\u3001\u66f4\u597d\u7684\u7528\u6237\u4f53\u9a8c\u3001\u66f4\u597d\u7684\u7cfb\u7edf\u8d44\u6e90\u5229\u7528\u3001\u4ee5\u53ca\u66f4\u65b9\u4fbf\u5730\u5728<\/p>\n","protected":false},"author":24,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15707,15706,12,384,23],"topic":[],"class_list":["post-9544","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-webapp","tag-app","tag-12","tag-384","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9544","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\/24"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=9544"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9544\/revisions"}],"predecessor-version":[{"id":9571,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9544\/revisions\/9571"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=9544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=9544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=9544"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=9544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<\/figure>\n<\/p>\n