如何使用 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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 03:43:37  来源:igfitidea点击:

How to open an existing GitHub project with Xcode?

iphonexcode

提问by why

I am new to xcodeand I want to learn iphone development.

我是xcode 的新手,我想学习 iphone 开发。

I found one demo project on github, I want to know how to open this existing project?

我在github上找到了一个 demo 项目,我想知道如何打开这个现有的项目?

回答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 .xcodeprojor .xcworkspacefile, 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 中打开”按钮。

https://cloud.githubusercontent.com/assets/19977/26796930/158f0a5c-49e0-11e7-8c26-eb666b7f666c.gif

https://cloud.githubusercontent.com/assets/19977/26796930/158f0a5c-49e0-11e7-8c26-eb666b7f666c.gif

That will trigger the git clonefor 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, select GitHuband enter your login credentials.

在 Xcode 中,导航到Preferences.../Accounts,选择GitHub并输入您的登录凭据。