ios 如何在项目目录中运行 pod install
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30418062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
how to run pod install in project directory
提问by Katie
A tutorial tells me to run pod install
in the project directory. Can anyone tell me how to do that?
一个教程告诉我pod install
在项目目录中运行。谁能告诉我怎么做?
回答by tbodt
Open Terminal.
If you haven't already done so, run this command:
sudo gem install cocoapods
Wait for it to finish before proceeding.
Find the project directory in the Finder. This should be the folder that has the Xcode project in it.
Type
cd
into the terminal, followed by a space.Drag and drop the project directory into the terminal window. It should now say something like this:
cd /Users/someone/Downloads/WonderfulProject
Press return.
Now type
pod install
. Wait for that to finish. It could take a while.
打开终端。
如果您还没有这样做,请运行以下命令:
sudo gem install cocoapods
等待它完成后再继续。
在 Finder 中找到项目目录。这应该是包含 Xcode 项目的文件夹。
键入
cd
到终端,后跟一个空格。将项目目录拖放到终端窗口中。它现在应该是这样的:
cd /Users/someone/Downloads/WonderfulProject
按回车。
现在输入
pod install
. 等待它完成。这可能需要一段时间。
Done!
完毕!
回答by cheznead
Close your Xcode project before you carry out the following steps.
在执行以下步骤之前关闭您的 Xcode 项目。
- First check if you have cocoapods installed. For this, type
pod --version
into the terminal and if a version no. is returned, you are good to move on to step 3. - If not installed, install cocoapods using the command
sudo gem install cocoapods
in terminal. - Next type
cd
and name of your Xcode project directory - Type
pod init
in terminal. This adds the podfile into your project where you can make edits. - Next type
pod install
.
- 首先检查你是否安装了cocoapods。为此,请输入
pod --version
终端,如果版本号。返回,您可以继续执行第 3 步。 - 如果未安装,请使用
sudo gem install cocoapods
终端中的命令安装 cocoapods 。 cd
Xcode 项目目录的下一个类型和名称- 输入
pod init
端子。这会将 podfile 添加到您的项目中,您可以在其中进行编辑。 - 下一个类型
pod install
。
Now, if a Podfile already exists in your Xcode project folder, for example if the tutorial already added it into the project for you, then you can just carry out step 5, provided you have cd-ed into your Xcode project directory.
现在,如果 Podfile 已存在于您的 Xcode 项目文件夹中,例如,如果教程已经为您将其添加到项目中,那么您只需执行第 5 步,前提是您已 cd-ed 进入您的 Xcode 项目目录。