{"id":18555,"date":"2024-03-14T12:33:05","date_gmt":"2024-03-14T04:33:05","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=18555"},"modified":"2024-03-14T12:33:05","modified_gmt":"2024-03-14T04:33:05","slug":"iospod%e6%89%93%e5%8c%85sdk%e4%bd%9c%e7%94%a8%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/18555\/","title":{"rendered":"iospod\u6253\u5305sdk\u4f5c\u7528\u4ecb\u7ecd"},"content":{"rendered":"

iOS\u7684Pod\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5728iOS\u9879\u76ee\u4e2d\u96c6\u6210\u7b2c\u4e09\u65b9\u5e93\u3002Pod\u81ea\u52a8\u5904\u7406\u7b2c\u4e09\u65b9\u5e93\u7684\u4f9d\u8d56\u5173\u7cfb\u548c\u7248\u672c\u7ba1\u7406\uff0c\u5927\u5927\u7b80\u5316\u4e86\u9879\u76ee\u7684\u7ba1\u7406\u548c\u6784\u5efa\u8fc7\u7a0b\u3002\u4e00\u4e2aPod\u5e93\u901a\u5e38\u5305\u62ec\u4e00\u7ec4\u6e90\u6587\u4ef6\u3001\u8d44\u6e90\u6587\u4ef6\u548c\u914d\u7f6e\u6587\u4ef6\u7b49\u3002<\/p>\n

\u4e0b\u9762\u662fPod\u6253\u5305SDK\u7684\u539f\u7406\u548c\u8be6\u7ec6\u4ecb\u7ecd\uff1a<\/p>\n

1. \u521b\u5efaSDK\u7684Podspec\u6587\u4ef6\uff1a\u5728SDK\u7684\u5de5\u7a0b\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a`[SDKName].podspec`\u7684\u6587\u4ef6\uff0c\u7528\u4e8e\u63cf\u8ff0SDK\u7684\u4fe1\u606f\u3001\u4f9d\u8d56\u5173\u7cfb\u548c\u6784\u5efa\u914d\u7f6e\u7b49\u3002<\/p>\n

2. \u914d\u7f6ePodspec\u6587\u4ef6\uff1a\u5728Podspec\u6587\u4ef6\u4e2d\uff0c\u9700\u8981\u6307\u5b9aSDK\u7684\u540d\u79f0\u3001\u7248\u672c\u53f7\u3001\u6e90\u7801\u8def\u5f84\u3001\u4f9d\u8d56\u5173\u7cfb\u3001\u8d44\u6e90\u6587\u4ef6\u3001\u7f16\u8bd1\u914d\u7f6e\u7b49\u3002Podspec\u6587\u4ef6\u91c7\u7528Ruby\u8bed\u6cd5\u7f16\u5199\uff0c\u53ef\u4ee5\u5305\u542b\u4e00\u4e9b\u53d8\u91cf\u548c\u65b9\u6cd5\u6765\u52a8\u6001\u914d\u7f6e\u3002<\/p>\n

3. \u521b\u5efaSDK\u7684\u5de5\u7a0b\uff1a\u5728SDK\u7684\u5de5\u7a0b\u76ee\u5f55\u4e2d\uff0c\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a`[SDKNamgcc\u6253\u5305ios<\/a>e].xcworkspace`\u7684\u5de5\u7a0b\u6587\u4ef6\uff0c\u7528\u4e8e\u96c6\u6210<\/p>\n

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

\u548c\u7ba1\u7406SDK\u7684\u6e90\u7801\u548c\u8d44\u6e90\u6587\u4ef6\u3002<\/p>\n

4. \u6dfb\u52a0\u4f9d\u8d56\u5e93\uff1a\u5728SDK\u7684\u5de5\u7a0b\u4e2d\uff0c\u901a\u8fc7Podfile\u6587\u4ef6\u6765\u6dfb\u52a0SDK\u7684\u4f9d\u8d56\u5e93\uff0c\u5305\u62ecSDK\u672c\u8eab\u7684\u4f9d\u8d56\u5e93\u548c\u5176\u4ed6\u7b2c\u4e09\u65b9\u5e93\u3002Podfile\u662f\u4e00\u4e2a\u7c7b\u4f3c\u4e8e\u811a\u672c\u7684\u6587\u4ef6\uff0c\u53ef\u4ee5\u5728\u5176\u4e2d\u58f0\u660e\u9700\u8981\u4f7f\u7528\u7684\u7b2c\u4e09\u65b9\u5e93\u3001\u6307\u5b9a\u7248\u672c\u548c\u6e90\u7b49\u3002<\/p>\n

5. \u914d\u7f6eSDK\u7684\u5de5\u7a0b\u6587\u4ef6\uff1a\u5728SDK\u7684\u5de5\u7a0b\u4e2d\uff0c\u914d\u7f6e\u4e00\u4e9b\u5fc5\u8981\u7684\u6784\u5efa\u914d\u7f6e\uff0c\u4f8b\u5982SDK\u7684\u7f16\u8bd1\u5668\u548c\u7248\u672c\u3001\u5de5\u7a0b\u7684\u76ee\u6807\u7248\u672c\u3001SDK\u7684\u8d44\u6e90\u8def\u5f84\u7b49\u3002<\/p>\n

6. \u5b89\u88c5\u4f9d\u8d56\u5e93\uff1a\u901a\u8fc7\u7ec8\u7aef\u8fdb\u5165SDK\u7684\u5de5\u7a0b\u76ee\u5f55\uff0c\u5e76\u8fd0\u884c`pod install`\u547d\u4ee4\u6765\u5b89\u88c5\u4f9d\u8d56\u5e93\u3002\u8be5\u547d\u4ee4\u4f1a\u6839\u636ePodfile\u6587\u4ef6\u81ea\u52a8\u4e0b\u8f7d\u3001\u5b89\u88c5\u548cios\u4e91\u6253\u5305\u9875\u9762\u7a7a\u767d<\/a>\u914d\u7f6e\u6240\u9700\u7684\u4f9d\u8d56\u5e93\u3002<\/p>\n

7. \u9a8c\u8bc1\u5de5\u7a0b\u914d\u7f6e\uff1a\u5728\u5b89\u88c5\u4f9d\u8d56\u5e93\u5b8c\u6210\u540e\uff0c\u6253\u5f00\u751f\u6210\u7684`.xcworkspace`\u6587\u4ef6\uff0c\u5e76\u786e\u8ba4\u5de5\u7a0b\u7684\u914d\u7f6e\u6b63\u786e\u65e0\u8bef\u3002<\/p>\n

8. \u6784\u5efaSDK\uff1a\u5728SDK\u7684\u5de5\u7a0b\u4e2d\uff0c\u9009\u62e9`Product` -> `Build`\u547d\u4ee4\u6765\u6784\u5efaSDK\uff0c\u751f\u6210\u9759\u6001\u5e93\u548c\u8d44\u6e90\u5305\u7b49\u3002<\/p>\n

9. \u5bfc\u51faSDK\uff1a\u6784\u5efa\u5b8c\u6210\u540e\uff0c\u53ef\u4ee5\u5728\u5de5\u7a0b\u7684`Products`\u76ee\u5f55\u4e2d\u627e\u5230\u751f\u6210\u7684\u9759\u6001\u5e93\u548c\u8d44\u6e90\u5305\u7b49\u3002\u5c06\u8fd9\u4e9b\u6587\u4ef6\u6253\u5305\u6210\u4e00\u4e2a\u4f9b\u5176\u4ed6\u5f00\u53d1\u8005\u4f7f\u7528\u7684SDK\u3002<\/p>\n

10. \u53d1\u5e03SDK\uff1a\u5c06\u6253\u5305\u597d\u7684SDK\u4e0a\u4f20\u5230\u4ee3\u7801\u6258\u7ba1\u5e73\u53f0\uff0c\u6216\u8005\u8bbe\u7f6e\u4e00\u4e2a\u79c1\u6709Pod\u4ed3\u5e93\u6765\u4f9b\u5176\u4ed6\u4eba\u4f7f\u7528\u3002<\/p>\n

\u901a\u8fc7\u4e0a\u8ff0\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u4e00\u4e2aiOS SDK\u6253\u5305\u6210\u4e00\u4e2aPod\uff0c\u65b9\u4fbf\u5176\u4ed6\u5f00\u53d1\u8005\u5728\u9879\u76ee\u4e2d\u4f7f\u7528\u3002Pod\u7684\u4f9d\u8d56\u7ba1\u7406\u548c\u7248\u672c\u63a7\u5236\u80fd\u529b\uff0c\u4f7f\u5f97SDK\u7684\u96c6\u6210\u548c\u66f4\u65b0\u53d8\u5f97\u7b80\u5355\u548c\u53ef\u9760\u3002Pod\u7684\u6253\u5305\u8fc7\u7a0b\u9700\u8981\u4e00\u4e9b\u914d\u7f6e\u548c\u547d\u4ee4\u884c\u64cd\u4f5c\uff0c\u4f46\u4e00\u65e6\u914d\u7f6e\u597d\uff0c\u540e\u7eed\u7684SDK\u6784\u5efa\u548c\u53d1\u5e03\u8fc7\u7a0b\u5c31\u4f1a\u53d8\u5f97\u5f88\u65b9\u4fbf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

iOS\u7684Pod\u662f\u4e00\u4e2a\u6d41\u884c\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\uff0c\u7528\u4e8e\u5728iOS\u9879\u76ee\u4e2d\u96c6\u6210\u7b2c\u4e09\u65b9\u5e93\u3002Pod\u81ea\u52a8\u5904\u7406\u7b2c\u4e09\u65b9\u5e93\u7684\u4f9d\u8d56\u5173\u7cfb\u548c\u7248\u672c\u7ba1\u7406\uff0c\u5927\u5927\u7b80\u5316\u4e86\u9879\u76ee\u7684\u7ba1\u7406\u548c\u6784\u5efa\u8fc7\u7a0b\u3002\u4e00\u4e2aPod\u5e93\u901a\u5e38\u5305\u62ec\u4e00\u7ec4\u6e90\u6587\u4ef6\u3001\u8d44\u6e90\u6587\u4ef6\u548c\u914d\u7f6e\u6587\u4ef6<\/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":[21267,21268,3275,16,865],"topic":[],"class_list":["post-18555","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-ionicios","tag-ios","tag-3275","tag-16","tag-865"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18555","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=18555"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18555\/revisions"}],"predecessor-version":[{"id":18622,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/18555\/revisions\/18622"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=18555"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=18555"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=18555"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=18555"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}