{"id":5343,"date":"2023-09-21T12:33:38","date_gmt":"2023-09-21T04:33:38","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=5343"},"modified":"2023-09-21T12:33:38","modified_gmt":"2023-09-21T04:33:38","slug":"ionic3%e6%89%93%e5%8c%85ios%e5%a6%82%e4%bd%95%e5%ae%9e%e7%8e%b0%e7%9a%84%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/5343\/","title":{"rendered":"ionic3\u6253\u5305ios\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},"content":{"rendered":"

Ionic \u662f\u4e00\u4e2a\u57fa\u4e8e Web \u6280\u672f\u6808\u7684\u8de8\u5e73\u53f0\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u4f7f\u7528\u4e00\u4e2a\u4ee3\u7801\u5e93\u6784\u5efa\u540c\u65f6\u8fd0\u884c\u5728\u591a\u4e2a\u5e73\u53f0\uff08\u5982 iOS\u3001Android \u548c Web\uff09\u7684\u5e94\u7528\u7a0b\u5e8f\u3002Ionic3 \u662f Ionic \u6846\u67b6\u7684\u7b2c\u4e09\u4e2a\u4e3b\u8981\u7248\u672c\uff0c\u63d0\u4f9b\u4e86\u8bb8\u591a\u65b0\u529funiapp\u53ef\u4ee5ios\u6253\u5305\u9ebd<\/a>\u80fd\u548c\u6539\u8fdb\u3002<\/p>\n

\u8981\u6253\u5305 Ionic3 \u5e94\u7528\u7a0b\u5e8f\u5e76\u5728 iOS \u8bbe\u5907\u4e0a\u8fd0\u884c\uff0c\u9700\u8981\u9075\u5faa\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n

1. \u5b89\u88c5\u5fc5\u8981\u7684\u8f6f\u4ef6\u4f9d\u8d56\uff1a<\/p>\n

– Xcode\uff1aXcode \u662f\u82f9\u679c\u7684\u96c6\u6210\u5f00\u53d1\u73af\u5883\uff08IDE\uff09\uff0c\u7528\u4e8e\u5f00\u53d1 iOS \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

– Node.js\uff1aNode.js \u662f\u8fd0\u884c\u5728\u670d\u52a1\u5668\u7aef\u7684 JavaScript \u8fd0\u884c\u73af\u5883\uff0c\u6211\u4eec\u9700\u8981\u4f7f\u7528\u5b83\u6765\u7ba1\u7406\u9879\u76ee\u4f9d\u8d56\u548c\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

– Ionic CLI\uff1aIonic CLI \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u521b\u5efa\u3001\u5f00\u53d1\u548c\u6784\u5efa Ionic \u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

2. \u521b\u5efa Ionic3 \u9879\u76ee\uff1a<\/p>\n

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

\u4f7f\u7528 Ionic CLI \u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Ionic3 \u9879\u76ee\u3002\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

“`<\/p>\n

ionic start myApp blank –type=ionic-angular<\/p>\n

“`<\/p>\n

3. \u5b89\u88c5 Cordova \u63d2\u4ef6\uff1a<\/p>\n

Ionic \u4f7f\u7528 Cordova \u53bb\u8bbf\u95ee\u8bbe\u5907\u7684\u786c\u4ef6\u529f\u80fd\u548c\u539f\u751f API\u3002\u8981\u6253\u5305 iOS \u5e94\u7528\u7a0b\u5e8f\uff0c\u9700\u8981\u5b89\u88c5\u9002\u5f53\u7684 Cordova \u63d2\u4ef6\u3002\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u5b89\u88c5\u4f8b\u5b50\u4e2d\u5e38\u7528\u7684\u63d2\u4ef6\uff1a<\/p>\n

“`<\/p>\n

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

ionic cordova plugin add cordova-plugin-geolocation<\/p>\n

“`<\/p>\n

4. \u914d\u7f6e iOS \u5e73\u53f0\uff1a<\/p>\n

\u9996\u5148\uff0c\u786e\u8ba4\u4f60\u5df2\u7ecf\u5b89\u88c5\u4e86\u6700\u65b0\u7248\u672c\u7684 Xcode\uff0c\u5e76\u4e14\u5728\u8fd9\u4e2a\u8fc7\u7a0b\u4e2d\u6253\u5f00\u8fc7\u5b83\u81f3\u5c11\u4e00\u6b21\u3002\u7136\u540e\uff0c\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5c06 iOS \u5e73\u53f0\u6dfb\u52a0\u5230\u4f60\u7684\u9879\u76ee\u4e2d\uff1a<\/p>\n

“`<\/p>\n

ionic cordova platform add ios<\/p>\n

“`<\/p>\n

5. \u751f\u6210 iOS \u9879\u76ee\u6587\u4ef6\uff1a<\/p>\n

\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u751f\u6210 iOS \u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\uff1a<\/p>\n

“`<\/p>\n

ionic cordova prepare ios<\/p>\n

“`<\/p>\n

6. \u6784\u5efa iOS \u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u6765\u6784\u5efa iOS \u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

“`<\/p>\n

ionic cordova build ios –prod<\/p>\n

“`<\/p>\n

7. \u5728 Xcode \u4e2d\u6253\u5f00\u9879\u76ee\uff1a<\/p>\n

\u6253\u5f00 `myApp\/platforms\/ios\/MyApp.xcworkspace` \u6587\u4ef6\uff0c\u7528 Xcode \u6253\u5f00\u4f60\u7684\u9879\u76ee\u3002\u5728 Xcode \u4e2d\u9009\u62e9\u4f60\u7684\u5f00\u53d1\u8005\u8d26\u53f7\u5e76\u914d\u7f6e\u8bc1\u4e66\u548c\u63cf\u8ff0\u6587\u4ef6\u3002<\/p>\n

8. \u5728 Xcode \u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff1a<\/p>\n

\u9009\u62e9\u4e00\u4e2a iOS \u6a21\u62df\u5668\u6216\u8fde\u63a5\u4e00\u4e2a iOS \u8bbe\u5907\uff0c\u5e76\u70b9\u51fb\u8fd0\u884c\u6309\u94ae\u3002Xcode \u5c06\u4f1aios\u7a0b\u5e8f\u53d1\u5e03\u6d4b\u8bd5\u6253\u5305<\/a>\u6784\u5efa\u5e76\u8fd0\u884c\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u5c06 Ionic3 \u5e94\u7528\u6253\u5305\u6210 iOS \u5e94\u7528\u7a0b\u5e8f\u7684\u7b80\u8981\u6b65\u9aa4\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u53ef\u80fd\u8fd8\u9700\u8981\u5904\u7406\u4e00\u4e9b\u5176\u5b83\u7ec6\u8282\u4e8b\u9879\uff0c\u5982\u5e94\u7528\u7a0b\u5e8f\u56fe\u6807\u3001\u542f\u52a8\u5c4f\u5e55\u3001\u63a8\u9001\u901a\u77e5\u7b49\u7b49\u3002\u638c\u63e1\u8fd9\u4e9b\u57fa\u672c\u6b65\u9aa4\u540e\uff0c\u4f60\u5c31\u53ef\u4ee5\u5f00\u59cb\u5728 iOS \u8bbe\u5907\u4e0a\u8fd0\u884c\u548c\u6d4b\u8bd5\u4f60\u7684 Ionic3 \u5e94\u7528\u7a0b\u5e8f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

Ionic \u662f\u4e00\u4e2a\u57fa\u4e8e Web \u6280\u672f\u6808\u7684\u8de8\u5e73\u53f0\u79fb\u52a8\u5e94\u7528\u5f00\u53d1\u6846\u67b6\uff0c\u53ef\u4ee5\u5e2e\u52a9\u5f00\u53d1\u8005\u4f7f\u7528\u4e00\u4e2a\u4ee3\u7801\u5e93\u6784\u5efa\u540c\u65f6\u8fd0\u884c\u5728\u591a\u4e2a\u5e73\u53f0\uff08\u5982 iOS\u3001Android \u548c Web\uff09\u7684\u5e94\u7528\u7a0b\u5e8f\u3002Ionic3 \u662f Ionic <\/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":[10038,10037,832,12,23],"topic":[],"class_list":["post-5343","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-ios","tag-unityios","tag-832","tag-12","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5343","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=5343"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/5343\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=5343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=5343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=5343"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=5343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}