如何复制我的xcode项目? (iPhone SDK)

时间:2022-10-30 13:15:36

How do I duplicate my xcode project? (iPhone SDK)

如何复制我的xcode项目? (iPhone SDK)

By the way, I simply duplicated/renamed the entire project folder. But when I started working in the new (duplicated) project (after changing app ids, provisioning profiles) I started getting errors about targets. I have no clue about what targets are or anything either so. Hmmm. Hope this works.

顺便说一句,我只是复制/重命名整个项目文件夹。但是,当我开始处理新的(重复的)项目(更改应用程序ID,配置配置文件后)时,我开始收到有关目标的错误。我不知道目标是什么或什么都是如此。嗯。希望这有效。

5 个解决方案

#1


16  

While all the above answers are correct, I believe we should ask WHY you are doing this. If you want to make a lite version of your app or a version with a subtle difference, you should explore duplicating targets, not duplicating entire projects.

虽然以上所有答案都是正确的,但我相信我们应该问你为什么这样做。如果您想制作应用程序的精简版本或具有细微差别的版本,您应该探索重复目标,而不是复制整个项目。

#2


4  

Just make a copy of the folder your project is in, then use the project file from your copy. You can also make a snapshot, if you're just looking to backup before you try some code ideas.

只需复制项目所在的文件夹,然后使用副本中的项目文件。如果您在尝试某些代码构思之前只想查看备份,也可以制作快照。

#3


2  

An alternative - consider getting a free source control system like svn, git or mercurial (or perforce or other commercial systems offer free licenses for limited use)* and then do anything you like to your project. You can always go back to an earlier version if you don't like the results. If you want to get more complicated you can branch it. This is one of the biggest steps you can take towards working in a professional manner.

另一种选择 - 考虑获得免费的源控制系统,如svn,git或mercurial(或perforce或其他商业系统提供有限使用的免费许可证)*然后对您的项目做任何您喜欢的事情。如果您不喜欢结果,可以随时返回早期版本。如果你想变得更复杂,你可以分支它。这是您以专业方式工作的最重要步骤之一。

*anything but Visual SourceSafe. Don't use that! CVS is probably best avoided too.

*除了Visual SourceSafe之外的任何东西。不要用那个! CVS也可能是最好的避免。

#4


2  

When you build an app in XCode for a device such as the iPhone, XCode uses a simulator for the device and puts the package in the simulater folder in the user library under ~/[USER]/Library/Application Support[SIMULATOR]/[VERSION]/Applications/[UID]. For the iPhone under IOS 6 it would be in ~/[USER]/Library/Application Support/iPhone Simulator/6.0/Applications/[UID].

当您在XCode中为iPhone等设备构建应用程序时,XCode会为设备使用模拟器,并将软件包放在〜/ [USER] / Library / Application Support [SIMULATOR] / [下的用户库中的simulater文件夹中。 VERSION] /应用/ [UID]。对于IOS 6下的iPhone,它将在〜/ [USER] / Library / Application Support / iPhone Simulator / 6.0 / Applications / [UID]中。

The UID (Uniqe Identifier), which looks like 061A54D9-2D96-4BE2-8C58-A8115A15ADA2, is where the problem is, because the project header file (project.pbxproj in the [PROJECT NAME].xcodeproj package) references it.

UID(Uniqe Identifier),看起来像061A54D9-2D96-4BE2-8C58-A8115A15ADA2,问题出在哪里,因为项目头文件([PROJECT NAME] .xcodeproj包中的project.pbxproj)引用它。

If you copy your project to another volume ad build it there, a new UID will be generated, but project.pbxproj will still use the old UID for referencing and it will not be able to find the resources for the simulator, such as the storyboard and the graphics.

如果您将项目复制到另一个卷广告,那么将生成一个新的UID,但project.pbxproj仍然会使用旧的UID进行引用,它将无法找到模拟器的资源,例如故事板和图形。

Replace the new UID with the old one and things should be fine.

用旧的UID替换新的UID,事情应该没问题。

#5


-7  

You should be able to copy-and-paste your project directory to another folder without any issues.

您应该能够将项目目录复制并粘贴到另一个文件夹而不会出现任何问题。

#1


16  

While all the above answers are correct, I believe we should ask WHY you are doing this. If you want to make a lite version of your app or a version with a subtle difference, you should explore duplicating targets, not duplicating entire projects.

虽然以上所有答案都是正确的,但我相信我们应该问你为什么这样做。如果您想制作应用程序的精简版本或具有细微差别的版本,您应该探索重复目标,而不是复制整个项目。

#2


4  

Just make a copy of the folder your project is in, then use the project file from your copy. You can also make a snapshot, if you're just looking to backup before you try some code ideas.

只需复制项目所在的文件夹,然后使用副本中的项目文件。如果您在尝试某些代码构思之前只想查看备份,也可以制作快照。

#3


2  

An alternative - consider getting a free source control system like svn, git or mercurial (or perforce or other commercial systems offer free licenses for limited use)* and then do anything you like to your project. You can always go back to an earlier version if you don't like the results. If you want to get more complicated you can branch it. This is one of the biggest steps you can take towards working in a professional manner.

另一种选择 - 考虑获得免费的源控制系统,如svn,git或mercurial(或perforce或其他商业系统提供有限使用的免费许可证)*然后对您的项目做任何您喜欢的事情。如果您不喜欢结果,可以随时返回早期版本。如果你想变得更复杂,你可以分支它。这是您以专业方式工作的最重要步骤之一。

*anything but Visual SourceSafe. Don't use that! CVS is probably best avoided too.

*除了Visual SourceSafe之外的任何东西。不要用那个! CVS也可能是最好的避免。

#4


2  

When you build an app in XCode for a device such as the iPhone, XCode uses a simulator for the device and puts the package in the simulater folder in the user library under ~/[USER]/Library/Application Support[SIMULATOR]/[VERSION]/Applications/[UID]. For the iPhone under IOS 6 it would be in ~/[USER]/Library/Application Support/iPhone Simulator/6.0/Applications/[UID].

当您在XCode中为iPhone等设备构建应用程序时,XCode会为设备使用模拟器,并将软件包放在〜/ [USER] / Library / Application Support [SIMULATOR] / [下的用户库中的simulater文件夹中。 VERSION] /应用/ [UID]。对于IOS 6下的iPhone,它将在〜/ [USER] / Library / Application Support / iPhone Simulator / 6.0 / Applications / [UID]中。

The UID (Uniqe Identifier), which looks like 061A54D9-2D96-4BE2-8C58-A8115A15ADA2, is where the problem is, because the project header file (project.pbxproj in the [PROJECT NAME].xcodeproj package) references it.

UID(Uniqe Identifier),看起来像061A54D9-2D96-4BE2-8C58-A8115A15ADA2,问题出在哪里,因为项目头文件([PROJECT NAME] .xcodeproj包中的project.pbxproj)引用它。

If you copy your project to another volume ad build it there, a new UID will be generated, but project.pbxproj will still use the old UID for referencing and it will not be able to find the resources for the simulator, such as the storyboard and the graphics.

如果您将项目复制到另一个卷广告,那么将生成一个新的UID,但project.pbxproj仍然会使用旧的UID进行引用,它将无法找到模拟器的资源,例如故事板和图形。

Replace the new UID with the old one and things should be fine.

用旧的UID替换新的UID,事情应该没问题。

#5


-7  

You should be able to copy-and-paste your project directory to another folder without any issues.

您应该能够将项目目录复制并粘贴到另一个文件夹而不会出现任何问题。