如何使用 Xcode 打开现有的 GitHub 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5156083/
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 open an existing GitHub project with Xcode?
提问by why
回答by j_freyre
- Download the project via git / or zip
- Open folder
- Double click on .xcodeproj file
- if on the top left, you see a something like "Base sdk missing"
- Double click on the first item in the three
- Go to tag build
- Select a sdk for the Base SDK
- Close the opened popup
- Click on build an run
- If you have error, you should see a red icon on the right bottom
- 通过 git / 或 zip 下载项目
- 打开文件夹
- 双击 .xcodeproj 文件
- 如果在左上角,您会看到类似“缺少基础 sdk”的内容
- 双击三个中的第一项
- 转到标记构建
- 为基础 SDK选择一个SDK
- 关闭打开的弹窗
- 单击构建运行
- 如果出现错误,您应该会在右下角看到一个红色图标
回答by VonC
Note: since June 2016, you can open your demo GitHub project in Xcode directly from the GitHub site!
注意:自 2016 年 6 月起,您可以直接从 GitHub 站点在 Xcode 中打开演示 GitHub 项目!
But you will need the latest Xcode 9, announced at the 2017 WWDC
但是你需要最新的 Xcode 9,在 2017 WWDC 上宣布
See "Clone in Xcode"
请参阅“在 Xcode 中克隆”
It's easy to explore code in your browser when you visit a GitHub repository, but you often want to pull that code directly into the appropriate editor and try it out.
For example, if the repository contains an.xcodeproj
or.xcworkspace
file, you might want to open that code in Xcode.This is possible starting today with the new "Open in Xcode" button.
当您访问 GitHub 存储库时,在浏览器中探索代码很容易,但您通常希望将该代码直接拉入适当的编辑器并进行尝试。
例如,如果存储库包含一个.xcodeproj
或.xcworkspace
文件,您可能希望在 Xcode 中打开该代码。从今天开始,可以使用新的“在 Xcode 中打开”按钮。
That will trigger the git clone
for you.
那会git clone
为你触发。
Note: as illustrated in "Unable to see “Open in Xcode” button on GitHub", you also have to be logged in to GitHub in Xcode as well.
注意:如“无法在 GitHub 上看到“在 Xcode 中打开”按钮”所示,您还必须在 Xcode 中登录到 GitHub。
In Xcode, navigate to
Preferences.../Accounts
, selectGitHub
and enter your login credentials.
在 Xcode 中,导航到
Preferences.../Accounts
,选择GitHub
并输入您的登录凭据。