{"id":2962,"date":"2023-08-16T12:33:45","date_gmt":"2023-08-16T04:33:45","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=2962"},"modified":"2023-08-16T12:33:45","modified_gmt":"2023-08-16T04:33:45","slug":"hbuildx%e6%89%93%e5%8c%85ios%e5%ae%89%e8%a3%85%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/2962\/","title":{"rendered":"hbuildx\u6253\u5305ios\u5b89\u88c5\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"

\u5f53\u6211\u4eec\u8981\u5728iOS\u4e0a\u53d1\u5e03\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u3002\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u5c06\u5404\u79cd\u4ee3\u7801\u3001\u8d44\u6e90\u548c\u914d\u7f6e\u6587\u4ef6\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u4ee5\u521b\u5efa\u6700\u7ec8\u4ea4\u4ed8\u7ed9\u7528\u6237\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5728iOS\u4e0a\uff0c\u6211\u4eec\u4f7f\u7528\u5de5\u5177hbuildx\u6765\u5b8c\u6210\u8fd9\u4e2a\u4efb\u52a1\u3002<\/p>\n

hbuildx\u662f\u4e00\u4e2a\u5f3a\u5927\u7684\u6253\u5305\u5de5\u5177\uff0c\u5b83\u53ef\u4ee5\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u6253\u5305\u4e3a\u539f\u751fiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u5b83\u57fa\u4e8eCordova\u6846\u67b6\uff0c\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u6280\u672f\u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u4e0b\u9762\u662fhbuildx\u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u7684\u8fc7\u7a0b\uff1a<\/p>\n

1. \u51c6\u5907\u5de5\u4f5c\uff1a\u5728\u5f00\u59cb\u6253\u5305\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u786e\u4fdd\u6240\u9700\u7684\u8f6f\u4ef6\u5df2\u6b63\u786e\u5b89\u88c5\u548c\u914d\u7f6e\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u5b89\u88c5Node.js\u548cnpm\uff08Node\u5305\u7ba1\u7406\u5668\uff09\u3002Node.js\u662f\u57fa\u4e8eJavaScript\u7684\u8de8\u5e73\u53f0\u8fd0\u884c\u73af\u5883\uff0cnpm\u662f\u7ba1\u7406\u548c\u5206\u53d1JavaScript\u5305\u7684\u5de5\u5177\u3002\u6211\u4eec\u8fd8\u9700\u8981\u5b89\u88c5Cordova CLI\uff08\u547d\u4ee4\u884c\u754c\u9762\uff09\uff0c\u5b83\u662f\u4e00\u4e2a\u7528\u4e8e\u6784\u5efaCordova\u5e94\u7528\u7a0b\u5e8f\u7684\u547d\u4ee4\u884c\u5de5\u5177\u3002<\/p>\n

2. \u521b\u5efaCordova\u9879\u76ee\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\uff0c\u8fdb\u5165\u9879\u76ee\u6240\u5728\u7684\u6587\u4ef6\u5939\uff0c\u5e76\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a\u65b0uniapp\u6253\u5305\u7684ios\u76f4\u63a5\u95ea\u9000<\/a>\u7684Cordova\u9879\u76ee\uff1a<\/p>\n

“`<\/p>\n

cord<\/p>\n

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

ova create MyApp com.example.myapp MyApp<\/p>\n

“`<\/p>\n

\u8fd9\u5c06\u521b\u5efa\u4e00\u4e2a\u540d\u4e3aMyApp\u7684\u65b0\u9879\u76ee\uff0c\u5305\u542b\u4e00\u4e2a\u6807\u8bc6\u4e3acom.example.myapp\u7684\u5e94\u7528\u7a0b\u5e8f\u5305\u540d\u3002<\/p>\n

3. \u6dfb\u52a0\u5e73\u53f0\uff1a\u8fdb\u5165\u9879\u76ee\u6587\u4ef6\u5939\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0iOS\u5e73\u53f0\u5230\u9879\u76ee\u4e2d\uff1a<\/p>\n

“`<\/p>\n

cordova platform add ios<\/p>\n

“`<\/p>\n

\u8fd9\u5c06\u4e3aiOS\u521b\u5efa\u4e00\u4e2a\u5e73\u53f0\u76ee\u5f55\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u6dfb\u52a0\u6240\u9700\u7684\u6587\u4ef6\u548c\u914d\u7f6e\u3002<\/p>\n

4. \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff1a\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\uff0c\u6253\u5f00config.xml\u6587\u4ef6\uff0c\u5e76\u6839\u636e\u9700\u8981\u4fee\u6539\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\u3001\u5305\u540d\u3001\u7248\u672c\u53f7\u7b49\u4fe1\u606f\u3002<\/p>\n

5. \u6dfb\u52a0\u63d2\u4ef6\uff1a\u6839\u636e\u9879\u76ee\u9700\u6c42\uff0c\u53ef\u4ee5\u6dfb\u52a0\u4e00\u4e9bCordova\u63d2\u4ef6\u6765\u6269\u5c55\u5e94\u7528\u7a0b\u5e8f\u7684\u529f\u80fd\u3002\u4f8b\u5982\uff0c\u5982\u679c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u8bbe\u5907\u7684\u76f8\u673a\u529f\u80fd\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6dfb\u52a0\u76f8\u673a\u63d2\u4ef6\uff1a<\/p>\n

“`<\/p>\n

cordova plugin add cordova-plugin-camera<\/p>\n

“`<\/p>\n

6. \u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\uff1a\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u6280\u672f\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u7684\u754c\u9762\u548c\u529f\u80fd\u3002\u5c06\u6240\u6709\u76f8\u5173\u6587\u4ef6\u653e\u5728www\u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n

7. \u8c03\u8bd5\u5e94\u7528\u7a0b\u5e8f\uff1a\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6d4f\u89c8\u5668\u6216\u6a21\u62df\u5668\u6765\u8c03\u8bd5\u5e94\u7528\u7a0b\u5e8f\u3002\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u6d4f\u89c8\u5668\u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

“`<\/p>\n

cordova serve<\/p>\n

“`<\/p>\n

\u8fd9\u5c06\u542f\u52a8\u4e00\u4e2a\u672c\u5730\u670d\u52a1\u5668\uff0c\u5e76\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5e94\u7528\u7a0b\u5e8f\u7684\u8c03\u8bd5\u754c\u9762\u3002<\/p>\n

8. \u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\uff1a\u5b8c\u6210\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\u540e\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528hbuildx\u8fdb\u884c\u6253\u5305\u3002\u5728\u9879\u76ee\u6587\u4ef6\u5939\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6784\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

“`<\/p>\n

hbuildx build ios<\/p>\n

“`<\/p>\n

\u8fd9\u5c06\u89e6\u53d1hbuildx\u5de5\u5177\uff0c\u5c06\u5e94\u7528\u7a0b\u5e8f\u7684\u4ee3\u7801\u548c\u8d44\u6e90\u6253\u5305\u4e3a\u4e00\u4e2a\u539f\u751fiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6e\u4e0d\u540c\u7684\u53c2\u6570\u6765\u5b9a\u5236\u5e94\u7528\u7a0b\u5e8f\u7684\u6253\u5305\u65b9\u5f0f\u548c\u8f93\u51fa\u683c\u5f0f\u3002<\/p>\n

9. \u5b89\u88c5\u548c\u6d4b\u8bd5\u5e94\u7528\u7a0b\u5e8f\uff1a\u6253\u5305\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u4f7f\u7528Xcode\u5c06\u5e94\u7528\u7a0b\u5e8f\u5b89\u88c5\u5230iOS\u8bbe\u5907\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u3002\u5c06\u6253\u5305\u751f\u6210\u7684.ipa\u6587\u4ef6\u5bfc\u5165\u5230Xcode\u4e2d\uff0c\u7136\u540e\u8fde\u63a5\u8bbe\u5907\u5e76\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528hbuildx\u6253ios \u6253\u5305\u5931\u8d25<\/a>\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u7684\u8be6\u7ec6\u6b65\u9aa4\u3002\u901a\u8fc7\u4f7f\u7528hbuildx\u5de5\u5177\uff0c\u6211\u4eec\u53ef\u4ee5\u65b9\u4fbf\u5730\u5c06Web\u5e94\u7528\u7a0b\u5e8f\u8f6c\u5316\u4e3a\u539f\u751fiOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u5feb\u901f\u53d1\u5e03\u5230App Store\u4f9b\u7528\u6237\u4e0b\u8f7d\u548c\u4f7f\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5f53\u6211\u4eec\u8981\u5728iOS\u4e0a\u53d1\u5e03\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u65f6\uff0c\u6700\u91cd\u8981\u7684\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u3002\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u5c06\u5404\u79cd\u4ee3\u7801\u3001\u8d44\u6e90\u548c\u914d\u7f6e\u6587\u4ef6\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u4ee5\u521b\u5efa\u6700\u7ec8\u4ea4\u4ed8\u7ed9\u7528\u6237\u7684\u53ef\u6267\u884c\u6587\u4ef6\u3002\u5728iOS\u4e0a\uff0c\u6211\u4eec\u4f7f\u7528\u5de5\u5177hbuildx\u6765\u5b8c<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[6063,6064,12,16,23],"topic":[],"class_list":["post-2962","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-ios","tag-unityios","tag-12","tag-16","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2962","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\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=2962"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/2962\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=2962"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=2962"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=2962"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=2962"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}