如何压缩 Xcode 项目?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3229549/
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 do you zip a Xcode project?
提问by Morry
Tired sending my friend an XCODE project , but files are missing? No idea why?
厌倦了向我的朋友发送 XCODE 项目,但文件丢失了?不知道为什么?
Any ideas
有任何想法吗
回答by Avalanchis
Right click (Ctrl-Click with a single button mouse) on the project's root folder and choose compress.
右键单击(使用单键鼠标按住 Ctrl 键单击)项目的根文件夹并选择压缩。
A zip file will be created with the compressed contents of the project folder.
将使用项目文件夹的压缩内容创建一个 zip 文件。
Send this file to your friend.
将此文件发送给您的朋友。
回答by Naishta
There is nothing wrong with this question although some of the guys have sort of downvoted it. Most of us who come from Windows background + learning Objective C or Swift will have this issue.
这个问题没有任何问题,尽管有些人有点低估了它。我们大多数来自 Windows 背景 + 学习 Objective C 或 Swift 的人都会遇到这个问题。
( ref: latest Xcode 7, but should be the same in other versions too)
(参考:最新的 Xcode 7,但在其他版本中也应该相同)
So, first LOCATE the project. say you have opened ViewController.swift on Xcode. If you look towards the right menu, there is this 'Identity and Type' section which has the 'Full Path' of you project.
所以,首先找到项目。假设您已经在 Xcode 上打开了 ViewController.swift。如果您看向右侧菜单,则有此“身份和类型”部分,其中包含您项目的“完整路径”。
eg: /Desktop/CLASS ASSIGNMENT/Registration App Ver 1.2 2 2 2/Registration App Ver 1.2/LoginVC.swift.
例如:/Desktop/CLASS ASSIGNMENT/Registration App Ver 1.2 2 2 2/Registration App Ver 1.2/LoginVC.swift。
Now if you go to this location via the 'Finder' in your dock( 1 folder up), thats where your project is.
现在,如果您通过 Dock 中的“Finder”(向上 1 个文件夹)转到此位置,这就是您的项目所在的位置。
-- Second: Right click and select 'Compress your_folder_name' option which zips the project and keeps it in the same location.
-- 第二:右键单击并选择“压缩 your_folder_name”选项,该选项会压缩项目并将其保存在同一位置。
You can now attach this in your email and share.
您现在可以将其附加到您的电子邮件中并分享。
回答by Silverlock
Make sure you're zipping the entire directory that contains the project. Just sending the .xcodeproj file and the source won't do it. You need the whole set of data.
确保您正在压缩包含项目的整个目录。只是发送 .xcodeproj 文件,源不会这样做。您需要完整的数据集。
回答by Noel M
Assuming you understand how to use the Terminal.app:
假设您了解如何使用 Terminal.app:
In the directory above your project:
在你的项目上面的目录中:
tar cvzf <name_of_project>.tar.gz <directory_of_project>
tar cvzf <name_of_project>.tar.gz <directory_of_project>
This will create a .tar.gz
file for your project, which is compressed archive, similar to .zip
这将为.tar.gz
您的项目创建一个文件,该文件是压缩存档,类似于.zip
Your friend can then run tar xvzf <name_of_project>.tar.gz
to expand to a directory on their computer.
然后,您的朋友可以运行tar xvzf <name_of_project>.tar.gz
以扩展到他们计算机上的目录。
If you run man tar
from the command line, this will explain what all the command line arguments for tar do.
如果您从命令行运行man tar
,这将解释 tar 的所有命令行参数的作用。