{"id":5346,"date":"2023-09-21T12:33:38","date_gmt":"2023-09-21T04:33:38","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=5346"},"modified":"2023-09-21T12:33:38","modified_gmt":"2023-09-21T04:33:38","slug":"ionic2%e6%89%93%e5%8c%85ios%e6%96%b9%e6%b3%95%e6%ad%a5%e9%aa%a4%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/5346\/","title":{"rendered":"ionic2\u6253\u5305ios\u65b9\u6cd5\u6b65\u9aa4\u4ecb\u7ecd"},"content":{"rendered":"

\u4e3a\u4e86\u6253\u5305iOS\uff0c\u6211\u4eec\u9700\u8981\u51e0\u4e2a\u5de5\u5177\uff1a<\/p>\n

1. Xcode\uff1aXcode \u662f\u4e00\u79cd\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u7528\u4e8e\u521b\u5efa\u4e0e macOS\u3001iOS\u3001watchOS \u548c tvOS \u4e00\u8d77\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002Xcode \u53ef\u4ee5\u7528\u6765\u6253\u5305\u5e94\u7528\u7a0b\u5e8f\u548c\u53d1\u5e03\u5230 App Store \u4e0a\u3002<\/p>\n

2. Ionic CLI\uff1aIonic CLI \u662f\u4e00\u4e2a\u4e3a\u5f00\u53d1\u4eba\u5458\u63d0\u4f9b\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u6784\u5efa\u548c\u90e8\u7f72 Ionic \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

3. Cordova\uff1aCordova \u662f\u4e00\u4e2a\u8de8\u5e73\u53f0\u7684\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u6846\u67b6\uff0c\u5141\u8bb8\u60a8\u4f7f\u7528\u6807\u51c6 Web \u6280\u672f\uff08\u5982 HTML\u3001CSS \u548c JavaScript\uff09\u521b\u5efa\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f\u3002Cordova \u63d0\u4f9b\u4e86\u8bbf\u95ee\u8bbe\u5907\u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u529f\u80fd\u7684\u63d2\u4ef6\u3002<\/p>\n

\u73b0\u5728\u8ba9\u6211\u4eec\u6765\u770b\u770b\u5982\u4f55\u6253\u5305 iOS \u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

\u6b65\u9aa41\uff1a\u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6<\/p>\n

\u9996\u5148\uff0c\u60a8\u9700\u8981\u5728\u60a8\u7684 Mac \u4e0a\u5b89\u88c5 Xcode\u3001Ionic CLI \u548c Cordova\u3002\u5982\u679c\u60a8\u5c1a\u672a\u5b89\u88c5\u8fd9\u4e9b\u5de5\u5177\uff0c\u8bf7\u6309\u7167\u4ee5\u4e0b\u6b65\u9aa4\u8fdb\u884c\u5b89\u88c5\uff1a<\/p>\n

1. \u5728\u60a8\u7684 Mac \u4e0a\u5b89\u88c5 Xcode\uff1a\u60a8\u53ef\u4ee5\u4ece Mac App Store \u4e0a\u4e0b\u8f7d\u548c\u5b89\u88c5 Xcjenkins\u8fdc\u7a0b\u6253\u5305ios<\/a>ode\u3002<\/p>\n

2. \u5b89\u88c5 Ionic CLI\uff1a\u8981\u5b89\u88c5 Ionic CLI\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

npm install -g ionic<\/p>\n

3. \u5b89\u88c5 Cordova\uff1a\u8981\u5b89\u88c5 Cordova\uff0c\u8bf7\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

npm install -g cordova<\/p>\n

\u6b65\u9aa42\uff1a\u5728\u547d\u4ee4\u884c\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Ionic \u9879\u76ee<\/p>\n

\u8981\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Ionic \u9879\u76ee\uff0c\u8bf7\u6253\u5f00\u7ec8\u7aef\uff0c\u5e76\u5728\u7ec8\u7aef\u4e2d\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u4ee5\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a myApp \u7684\u65b0\u9879\u76ee\uff1a<\/p>\n

ionic start myApp blank<\/p>\n

\u6b65\u9aa43\uff1a\u6dfb\u52a0 iOS \u5e73\u53f0<\/p>\n

\u8981\u5c06 Ionic \u9879\u76ee\u6784\u5efa\u4e3a iOS \u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u4f7f\u7528 Cordova \u547d\u4ee4\u884c\u5de5\u5177\u6dfb\u52a0 iOS \u5e73\u53f0\u3002\u5728\u7ec8\u7aef\u4e2d\uff0c\u5bfc\u822a\u5230\u60a8\u7684 Ionic \u9879\u76ee\u76ee\u5f55\uff0c\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

cordova platform add ios<\/p>\n

\u6b65\u9aa44\uff1a\u6784\u5efa\u60a8\u7684 iOS \u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u8981\u6784\u5efa\u60a8\u7684 iOS \u5e94\u7528\u7a0b\u5e8f\uff0c\u8bf7\u4f7f\u7528 Cordova \u547d\u4ee4\u884c\u5de5\u5177\u6784\u5efa\u60a8\u7684\u9879\u76ee\u3002\u5728\u7ec8\u7aef\u4e2d\uff0c\u5bfc\u822a\u5230\u60a8\u7684 Ionic \u9879\u76ee\u76ee\u5f55\uff0c\u5e76\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

ionic cordova build ios<\/p>\n

\u8fd9\u5c06\u4e3a\u60a8\u7684 iOS \u5e94\u7528\u7a0b\u5e8f\u521b\u5efa\u4e00\u4e2a Xcode \u9879\u76ee\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u5728\u60a8\u7684 Ionic \u9879\u76ee\u7684 platforms\/ios \u76ee\u5f55\u4e2d\u3002<\/p>\n

\u6b65\u9aa45\uff1a\u6253\u5f00 Xcode \u9879\u76ee<\/p>\n

\u60a8\u73b0\u5728\u53ef\u4ee5\u6253\u5f00 Xcode \u9879\u76ee\uff0c\u5e76\u6784\u5efa\u3001\u6d4b\u8bd5\u548c\u90e8\u7f72\u60a8\u7684 iOS \u5e94\u7528\u7a0b\u5e8f\u3002\u5728\u7ec8\u7aef\u4e2d\uff0c\u5bfc\u822a\u5230\u60a8\u7684 Ionic \u9879\u76ee\u7684 platforms\/ios \u76ee\u5f55\uff0c\u5e76\u53cc\u51fb\u8be5\u9879\u76ee\u4e2d\u7684 .xcodeproj \u6587\u4ef6\uff0c\u4ee5\u5728 Xcode \u4e2d\u6253\u5f00\u9879\u76ee\u3002<\/p>\n

\u6b65\u9aa46\uff1a\u4e3a\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u914d\u7f6e\u4ee3\u7801\u7b7e\u540d<\/p>\n

\u5728 Xcode \u4e2d\uff0c\u9009\u62e9\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u540d\u79f0\uff0c\u7136\u540e\u5355\u51fb\u201cGeneral\u201d\u9009\u9879\u5361\u3002uniapp\u6253\u5305ios\u9700\u8981\u79c1\u94a5<\/a>\u5728\u201cIdentity\u201d\u90e8\u5206\u4e2d\uff0c\u9009\u62e9\u60a8\u7684\u5f00\u53d1\u8005\u8bc1\u4e66\uff0c\u5e76\u4e3a\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u6307\u5b9a Bundle Identifier\u3002<\/p>\n

\u6b65\u9aa47\uff1a\u6784\u5efa\u5e76\u6253\u5305\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u5728 Xco<\/p>\n

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

de \u4e2d\uff0c\u9009\u62e9\u201cProduct\u201d>\u201cArchive\u201d\u9009\u9879\uff0c\u4ee5\u6784\u5efa\u5e76\u6253\u5305\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u6b64\u65f6\u60a8\u8fd8\u53ef\u4ee5\u5728\u201cOrganizer\u201d\u4e2d\u9a8c\u8bc1\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u6b65\u9aa48\uff1a\u53d1\u5e03\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f<\/p>\n

\u8981\u5c06\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u53d1\u5e03\u5230 App Store\uff0c\u8bf7\u6309\u7167 Apple \u7684\u6307\u5357\u64cd\u4f5c\u3002\u5728\u6b64\u8fc7\u7a0b\u4e2d\uff0c\u60a8\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u5546\u5e97\u4e2d\u7684\u5f00\u53d1\u8005\u5e10\u6237\uff0c\u5e76\u63d0\u4ea4\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u7684\u8be6\u7ec6\u4fe1\u606f\u3002\u4e00\u65e6\u60a8\u7684\u5e94\u7528\u7a0b\u5e8f\u88ab\u6279\u51c6\uff0c\u5b83\u5c31\u4f1a\u5728 App Store \u4e0a\u5411\u516c\u4f17\u53d1\u5e03\u3002<\/p>\n

\u4ee5\u4e0a\u662f Ionic2 \u6253\u5305 iOS \u5e94\u7528\u7a0b\u5e8f\u7684\u8be6\u7ec6\u8fc7\u7a0b\u3002\u603b\u4e4b\uff0c\u6b65\u9aa4\u53ef\u80fd\u6709\u4e9b\u7e41\u7410\uff0c\u4f46\u662f\u5982\u679c\u60a8\u8ddf\u968f\u5e76\u9075\u5b88\u4e86\u6240\u6709\u6b65\u9aa4\uff0c\u60a8\u5c31\u53ef\u4ee5\u6210\u529f\u5730\u6253\u5305\u51fa\u4e00\u4e2a\u53ef\u7528\u7684 iOS \u5e94\u7528\u7a0b\u5e8f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4e3a\u4e86\u6253\u5305iOS\uff0c\u6211\u4eec\u9700\u8981\u51e0\u4e2a\u5de5\u5177\uff1a1. Xcode\uff1aXcode \u662f\u4e00\u79cd\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u7528\u4e8e\u521b\u5efa\u4e0e macOS\u3001iOS\u3001watchOS \u548c tvOS \u4e00\u8d77\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u3002Xcode \u53ef\u4ee5\u7528\u6765\u6253<\/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":[2754,10044,12,105,23],"topic":[],"class_list":["post-5346","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-electronios","tag-ios","tag-12","tag-105","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5346","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=5346"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5346\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=5346"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=5346"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=5346"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=5346"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}