views:

262

answers:

6

I have an app in the iPhone app store and have released several minor updates to it. I want to begin work on some major feature additions and reorganization, but don't want to lose the source code of my most recent version in case everything goes horribly wrong.

Should I start a new Xcode project from scratch and copy my existing source in? If I do this will I be able to submit the build from this new project as an update or will Apple complain that the build comes from a different Xcode project?

I've seen (but not used) Xcode's "Snapshots" and "Source Control" features - are these what I'm looking for?

Any help or direction greatly appreciated.

+9  A: 

I would suggest getting your project into some kind of Source Control. The popular ones these days are Subversion (Xcode has built-in support for it, but the support is pretty crappy), git, and Mercurial, all of which run great on the Mac.

You would add your project to a git/svn/hg/etc repository, and then "tag" the repository with something meaningful ("Shipping Version 1.3" or something) (alternatively you could just branch your project at its current state and give that a meaningful name). Then you can do your developments, add and commit the changes to your repository. If you need to revert back to your old shipping version, that's quite simple because you tagged it before you started work (think of a tag like a snapshot).

The other option is to start a fresh Xcode project and copy things over. I have personally done this and shipped just fine to the App Store (just make sure things like your app's bundle id "com.whatever.app" matches with the original one, and make sure you codesign properly) and you're good to go.

Having said that, unless you have a really great reason to start with a fresh project, you're probably better off using source control management with one of the aforementioned tools (git is my preference).

jbrennan
Every developer needs to be using some sort of source code management system for all but the smallest projects. You need to be able to track your changes, large or small. I actually like the built-in support for Subversion in Xcode, as it lets me see at a glance what I've changed since the last checkin, and it provides a nice graphical diff between selected versions. For anything more powerful, Cornerstone and Versions are great Mac subversion clients.
Brad Larson
Good to know! I think this will be really helpful for me...
Eric
+2  A: 

You are using some form of source control right? If not, stop what you are doing and make sure to set up an svn repository. Svn is bundled with your mac and integrates with Xcode.

You also may want to start thinking about doing backups...

villintehaspam
A: 

You can either do what the people said before, and use svn git or the like, OR if you don't want to mess around with any of that you can simply create your own version control by copying and pasting the folder and name it "project name x.x" and modify the version without the version number on it

Matt S.
While that does *work*, I can't see any reason (other than laziness) to do this over using proper Source Control such as git/svn/hg/etc.
jbrennan
That's the only reason why you would do that. Actually there's one more: You don't know how to use git/svn/hg/etc which could be fixed by doing a simple google search
Matt S.
A: 

snapshots are the first step. when you are comfortable with them you can hook up to an SVN server for your offsite backup

just make a snapshot after your distribution build and label with the version number

PeanutPower
A: 

The quickest, easiest, short-term solution is to select the Xcode project folder, and duplicate it. This will create a duplicate of everything in the project. Apple won't care that it comes from a duplicate project.

For the long term, look into setting up an SVN. This will help you save your previous versions every time you make changes.

GingerBreadMane
A: 

Since you are new to source control management so might I suggest using Subversion.

Subversion has less features than Git, but you don't have the confusion between pushing and committing (locally vs remotely) and you will find there is more software that supports Subversion than Git or Mercurial.

If you need a quick backup, you can always zip the current working folder for your Xcode project, then name it something like:

MyApplication-Version-1.00.zip

Brock Woolf