共享文件夹和 XCode

发布于 2024-08-13 01:17:37 字数 91 浏览 4 评论 0原文

有没有办法让 XCode 很好地处理共享文件夹并允许多人同时使用 iPhone 应用程序?或者我们是否需要切换到类似 SubEthaEdit 或其他实时协作工具的工具?

Is there a way to get XCode to play nice with shared folders and allow multiple people to work on an iPhone app at the same time? Or are we going to need to switch to something more like SubEthaEdit or some other realtime-collaboration tool?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

风月客 2024-08-20 01:17:37

众所周知,Xcode 在文件系统方面的表现非常糟糕。管理项目时,您有两种选择:将文件夹添加为组或文件夹引用。

如果你添加一个组,那么该文件夹将被镜像到Xcode中,但是该组不会与文件系统同步,也就是说你可以移动组内的东西,删除该组,不会触及FS,相反会使 Xcode 丢失文件。

第二个选项,添加文件夹引用听起来很不错,但完全有问题。文件夹引用可能无法正确更新,不会在文件夹内检测到更改(如果您向资源添加图像文件夹引用并更新内容,您的资源将不会在下次构建时更新,您必须清理并重新构建)。

这就是为什么你要么不使用 Xcode(我们在这里使用 vim + SCons,并且对此非常满意),要么需要使用 SCM(SCM 也可以与其他工具结合使用,无论如何你都应该使用 SCM)。

至于SCM我推荐Mercurial,但是还有SVN和Git等等很多,我建议你Google一下并发表你的意见。

Xcode is know to play very badly with the file system. When managing a project, you have two option, to add the folders as group or as folder references.

If you add a group, then the folder will be mirrored into Xcode, but the group won't be in sync with the filesystem, that is you can move things within the group, delete the group, won't touch the FS, reverse will make Xcode lose the files.

The second option, to add a folder reference sounds very sweet, but is totally bugged. Folder references might not update properly, changes are not detected within the folders (if you add an Images folder reference to your resources and update the content, your resources won't be updated on next build, you have to clean&rebuild).

This is why you should either not use Xcode (we use vim + SCons here and are very happy with it) or you need to use an SCM (SCM can be coupled with other tools too, you SHOULD use an SCM anyway).

As for the SCM I recommend Mercurial, but there is also SVN and Git and a lot of others, I suggest you Google a bit and make your opinion.

缱倦旧时光 2024-08-20 01:17:37

如果您使用 SCM,迄今为止最好的方法是签入 project.pbxproj
文件(在您的 .xcodeproj 包中)。大多数情况下,合并效果很好,有时您必须手动合并,但在这些情况下 90% 的情况下,您只需允许双方合并即可。

我的 .gitignore 文件如下所示:

# xcode noise
build/*
*.pbxuser
*.mode1v3
*.perspectivev3
*~
*.mode2v3

您可以对其他 SCM 系统使用类似的忽略指令集。

文件夹引用对于图像来说是可以的(但需要注意的是,如果更改任何图像内容,则必须进行清理),但对于源来说则不太好。

If you use an SCM, the best approach so far is to check in the project.pbxproj
file (inside your .xcodeproj bundle). Mostly that merges just fine, sometimes you have to manually merge but in those cases 90% of the time you simply allow both sides of the merge.

My .gitignore file looks like:

# xcode noise
build/*
*.pbxuser
*.mode1v3
*.perspectivev3
*~
*.mode2v3

You could use a similar ignore set of directives for other SCM systems.

Folder references are OK for images (with the caveat you have to do a Clean if you change any image contents) but are not great for source.

灰色世界里的红玫瑰 2024-08-20 01:17:37

让多人在共享文件夹上工作会导致灾难,当有人第一次覆盖您花了一上午时间编辑的文件时,您会后悔的,因为他们想更新其中的评论。

获取 SCM 并让每个人都将他们的代码签入自己的私人文件夹中。

当您的构建速度更快时,您也会感到更高兴,因为您是在本地磁盘而不是网络磁盘上构建的。

Letting multiple people work on a shared folder is a recipe for disaster, and you will regret it the first time somebody overwrites the file you've been editing for most of the morning because they wanted to update a comment in it.

Get a SCM and get everybody to check out their code into their own private folder.

You'll also be happier when your builds go faster because you're building off of a local disk instead of a network disk.

挥剑断情 2024-08-20 01:17:37

如果您希望进行实时协作,即两个或更多程序员实际上同时将相同的代码写入同一个文件,那么您将需要使用像 subethaedit 这样的协作编辑器。您可以将 subethaedit 设置为 Xcode 中源文件的首选编辑器。

这样,您就拥有了一名托管 Xcode 项目的程序员,他在 subethaedit 中打开源文件。然后其他程序员通过 subethaedit 登录到该文件。然后,托管程序员在本地 Xcode 中编译代码。

但是,正如上面 Rudedog 的评论中所述,如果您只想让多个人处理同一个项目但处理不同的文件,则应该使用代码管理工具。

If your looking a real-time collaboration i.e. two or more programmers actually writing the same code to the same file at the same time, you will need to use a collaborative editor like subethaedit. You can set subethaedit as the preferred editor for your source files in Xcode.

That way, you have one programmer who hosts the Xcode project, who opens up the source files in subethaedit. Other programmers then log into the file via subethaedit. Then the hosting programer compiles the code in his local Xcode.

However, as noted above in Rudedog's comment, if you just want to have multiple people working on same project but on different files, you should use a code management tool.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文