五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

cocoapods筆記1

2023-08-15 10:28 作者:便宜酒  | 我要投稿

1、什么是cocoapods?

CocoaPods manages library dependencies for your Xcode projects.

The dependencies for your projects are specified in a single text file called a Podfile. CocoaPods will resolve dependencies between libraries, fetch the resulting source code, then link it together in an Xcode workspace to build your project.

Ultimately the goal is to improve discoverability of, and engagement in, third party open-source libraries by creating a more centralised ecosystem.

簡言之,相當于java項目中maven所承擔的依賴管理部分的功能,相當于Android Studio里的build.gradle里對導(dǎo)入dependencies的片段的管理工具。

Cocoapods的原理是將所有的依賴庫的源碼下載到本地一個名為Pods的目錄中,并進行編譯。開發(fā)者只需' pod init '命令創(chuàng)建一個Podfile文件,書寫需要的依賴,然后cd到工作目錄下' pod install '命令即可下載。

2、cocoapods的下載(Mac M1,Ventura

cocoapods使用ruby語言編寫的,而ruby庫和程序是由Gem標準包管理的,ruby版本是由RVM(Ruby Version Manager)管理的。

所以大致步驟就是利用Gem安裝好Ruby環(huán)境,用rvm list 查看是否安裝ruby及其版本,rvm list known命令找到最新版本并下載,然后利用Ruby下載cocoapods。

但是實際會遇到很多問題,按網(wǎng)上步驟和官方文檔未必成功,找準自己哪一步出了什么問題,針對性多方參考。最終在https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/#step-2-install-chruby-and-the-latest-ruby-with-ruby-install

使用'?gem sources -l '命令查看Ruby鏡像,如果不是

https://gems.ruby-china.com/則是被墻的狀態(tài),則使用gem sources --remove [默認源],再用gem sources -a?https://gems.ruby-china.com/,就成功加入了調(diào)查兵團。如果這個不起作用了,那就是又炸了,網(wǎng)上找找最新的域名。


sudo gem install cocoapods嘗試是否可以下載。

3、cocoapods使用

·Step 1:

Check the?cocoapods.org?to make sure the libraries you would like to use are available.

https://cocoapods.org/

·Step 2:

Create a?Podfile, and add your dependencies:

Run?$ pod install?in your project directory.

Open?App.xcworkspace?and build.

To create a new project with CocoaPods, follow these simple steps:

  • Create a new project in Xcode as you would normally.

  • Open a terminal window, and?$ cd?into your project directory.

  • Create a Podfile. This can be done by running?$ pod init.

  • Open your Podfile. The first line should specify the platform and version supported.

  • In order to use CocoaPods you need to define the Xcode target to link them to. So for example if you are writing an iOS app, it would be the name of your app. Create a target section by writing?target '$TARGET_NAME' do?and an?end?a few lines after.

  • Add a CocoaPod by specifying??pod '$PODNAME'?on a single line inside your target block.

  • Save your Podfile.

  • Run?$ pod install

  • Open the?MyApp.xcworkspace?that was created. This should be the file you use everyday to create your app.

Integrating CocoaPods with an existing workspace requires one extra line in your Podfile. Simply specify the?.xcworkspace?filename in outside your target blocks like so:


cocoapods筆記1的評論 (共 條)

分享到微博請遵守國家法律
阆中市| 修武县| 青冈县| 高清| 五原县| 马山县| 尚义县| 砚山县| 昆山市| 鹤山市| 永吉县| 高密市| 行唐县| 平乐县| 黔南| 龙岩市| 棋牌| 西和县| 岢岚县| 大冶市| 天峻县| 宁陵县| 大庆市| 夏津县| 尖扎县| 黎城县| 隆回县| 双鸭山市| 鸡西市| 崇仁县| 新沂市| 西城区| 镇平县| 和政县| 嘉荫县| 克拉玛依市| 虹口区| 绥化市| 绥江县| 新平| 永嘉县|