{"id":498,"date":"2024-06-04T19:18:36","date_gmt":"2024-06-04T11:18:36","guid":{"rendered":"https:\/\/www.ixriver.com\/?p=498"},"modified":"2024-06-04T20:05:57","modified_gmt":"2024-06-04T12:05:57","slug":"5%e5%88%86%e9%92%9f%e4%ba%86%e8%a7%a3cocoapods%e7%9a%84%e4%bd%bf%e7%94%a8","status":"publish","type":"post","link":"https:\/\/www.v.ixriver.com\/?p=498","title":{"rendered":"5\u5206\u949f\u4e86\u89e3CocoaPods\u7684\u4f7f\u7528"},"content":{"rendered":"\n<p>CocoaPods\u662fiOS\u5f00\u53d1\u3001macOS\u5f00\u53d1\u4e2d\u7684\u5305\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\uff0c\u4f7f\u7528ruby\u7f16\u5199<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_65 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.v.ixriver.com\/?p=498\/#%E5%AE%89%E8%A3%85\" title=\"\u5b89\u88c5\">\u5b89\u88c5<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.v.ixriver.com\/?p=498\/#%E4%BD%BF%E7%94%A8\" title=\"\u4f7f\u7528\">\u4f7f\u7528<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.v.ixriver.com\/?p=498\/#%E5%BC%80%E6%BA%90%E5%BA%93%E6%94%AF%E6%8C%81Cocapods\" title=\"\u5f00\u6e90\u5e93\u652f\u6301Cocapods\">\u5f00\u6e90\u5e93\u652f\u6301Cocapods<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%AE%89%E8%A3%85\"><\/span>\u5b89\u88c5<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u4f7f\u7528ruby\u7684gem\u547d\u4ee4\u5b89\u88c5CocoaPods<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u67e5\u770bruby\u7248\u672c\u53f7\nruby --version\n\n\/\/ \u67e5\u770bgem\u7248\u672c\u53f7\ngem --version\n\n\/\/ gem \u7248\u672c\u53f7\u8fc7\u4f4e\uff0c\u56de\u5bfc\u81f4CocoaPods\u5b89\u88c5\u5931\u8d25\uff0c\u66f4\u65b0gem\nsudo gem update --system\n\n\/\/ \u67e5\u770bgem \u4f7f\u7528\u7684\u6e90\ngem source -l\n\n\/\/ \u5207\u6362gem \u4f7f\u7528\u7684\u6e90\ngem sources --remove https:\/\/rubygems.org\/\ngem sources -a https:\/\/ruby.taobao.org\/\n\n\/\/ \u5b89\u88c5cocoapods\nsudo gem install cocoapods\n\n\/\/ cocoapods \u521d\u59cb\u5316\npod setup\n\n\n\/\/ \u67e5\u770bpod \u7248\u672c\npod --version<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E4%BD%BF%E7%94%A8\"><\/span>\u4f7f\u7528<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>\/\/ \u5728.xcodeproj\u7684\u540c\u7ea7\u76ee\u5f55\u4e0b\u9762\u65b0\u5efa\u4e00\u4e2aPodfile\ntouch Podfile\n\n\/\/ \u7f16\u8f91Podfile\nplatform :ios, '11.0'\ntarget 'TestCocoaPods' do\n  pod 'SDWebImage', '~&gt; 4.3.2'\nend\n\n\/\/ \u5b89\u88c5\u4f9d\u8d56\npod install\n\n\/\/ \u66f4\u65b0\u4f9d\u8d56\npod update<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"%E5%BC%80%E6%BA%90%E5%BA%93%E6%94%AF%E6%8C%81Cocapods\"><\/span>\u5f00\u6e90\u5e93\u652f\u6301Cocapods<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>\u65b0\u5efapodspec\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pod spec create IDbg<\/code><\/pre>\n\n\n\n<p>\u7f16\u8f91podspec \u6587\u4ef6<\/p>\n\n\n\n<p>Public headers \u8bbe\u7f6e\uff1apublic_header_files<\/p>\n\n\n\n<p>\u94fe\u63a5framework\u8bbe\u7f6e\uff1avendored_frameworks<\/p>\n\n\n\n<p>\u94fe\u63a5\u8d44\u6e90\u6587\u4ef6\u8bbe\u7f6e\uff1aresources<\/p>\n\n\n\n<p>\u7f16\u8bd1\u8bbe\u7f6e\uff1as.xcconfig = {&#8216;OTHER_LDFLAGS&#8217; => &#8216;-ObjC -lz -lsqlite3 -lc -lresolv -lbz2 -liconv&#8217;,&#8221;HEADER_SEARCH_PATHS&#8221; => &#8216; &#8220;${PODS_ROOT}\/..\/..\/sdk\/third_party\/IDbg\/iOS\/IDbg.framework\/Headers&#8221;&#8216;}<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Pod::Spec.new do |spec|\n  spec.name         = \"IDbg\"\n  spec.version      = \"1.0.3\"\n  spec.summary      = \"IDbg client\"\n  spec.description  = \"debug tools\"\n  spec.homepage     = \"https:\/\/github.com\/oc-sample\/IDbg-sdk\"\n  spec.license      = { :type =&gt; \"MIT\", :file =&gt; \"LICENSE\" }\n  spec.author             = { \"mjsecurity\" =&gt; \"mjsecurity@126.com\" }\n  spec.ios.deployment_target = \"11.0\"\n  spec.source       = { :git =&gt; \"https:\/\/github.com\/oc-sample\/IDbg-sdk.git\", :tag =&gt; \"#{spec.version}\" }\n\n  spec.source_files  = \"IDbg.framework\/Headers\", \"*.{h,m}\"\n  spec.vendored_frameworks = 'IDbg.framework'\n  spec.pod_target_xcconfig = { 'EXCLUDED_ARCHS&#91;sdk=iphonesimulator*]' =&gt; 'arm64' }\n  spec.user_target_xcconfig = { 'EXCLUDED_ARCHS&#91;sdk=iphonesimulator*]' =&gt; 'arm64' }\n\nend<\/code><\/pre>\n\n\n\n<p>\u5206\u652f\u65b0\u5efatag\uff0c\u5e76\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>git tag 1.0.3\ngit push --tags<\/code><\/pre>\n\n\n\n<p>\u9a8c\u8bc1podspec\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pod spec lint IDbg.podspec<\/code><\/pre>\n\n\n\n<p>\u6ce8\u518cCocoapods<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pod trunk register mjsecurity@126.com '\u6635\u79f0\u540d' --description='\u63cf\u8ff0'<\/code><\/pre>\n\n\n\n<p>\u63d0\u4ea4\u81f3CocoaPods<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pod trunk push IDbg.podspec<\/code><\/pre>\n\n\n\n<p>\u4e5f\u53ef\u4ee5\u4e0d\u63a8\u9001Cocoapods\uff0c\u800c\u4ee5\u79c1\u6709\u5e93\u7684\u65b9\u5f0f\u4f7f\u7528\uff0c\u7528\u6cd5\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pod 'IDbg',git=&gt;\"https:\/\/XXX.git\"<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>CocoaPods\u662fiOS\u5f00\u53d1\u3001macOS\u5f00\u53d1\u4e2d\u7684\u5305\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\uff0c\u4f7f\u7528ruby\u7f16\u5199 \u5b89\u88c5 \u4f7f\u7528ruby\u7684gem [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"blocksy_meta":[],"featured_image_urls":{"full":"","thumbnail":"","medium":"","medium_large":"","large":"","1536x1536":"","2048x2048":""},"post_excerpt_stackable":"<p>CocoaPods\u662fiOS\u5f00\u53d1\u3001macOS\u5f00\u53d1\u4e2d\u7684\u5305\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\uff0c\u4f7f\u7528ruby\u7f16\u5199 \u76ee\u5f55 Toggle \u5b89\u88c5\u4f7f\u7528\u5f00\u6e90\u5e93\u652f\u6301Cocapods \u5b89\u88c5 \u4f7f\u7528ruby\u7684gem\u547d\u4ee4\u5b89\u88c5CocoaPods \/\/ &hellip;<\/p>\n","category_list":"<a href=\"https:\/\/www.v.ixriver.com\/?cat=22\" rel=\"category\">ios<\/a>","author_info":{"name":"admin","url":"https:\/\/www.v.ixriver.com\/?author=1"},"comments_num":"0 comments","_links":{"self":[{"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/posts\/498"}],"collection":[{"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=498"}],"version-history":[{"count":11,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/posts\/498\/revisions"}],"predecessor-version":[{"id":517,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=\/wp\/v2\/posts\/498\/revisions\/517"}],"wp:attachment":[{"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=498"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=498"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.v.ixriver.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=498"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}