Overview of steps to create new app from existing one

It'd be great if someone would give an overview of the steps to create a new app from an existing one. Can I copy my Xcode project to get started? After I copy my Xcode project, what do I need to do in Xcode? What do I need to do regarding certificate(s) and bundle id. Are there any steps where order is super important? Feel free, of course, to provide a link to an article and/or video on this as that'd be awesome if the information is current. What I've found online is typically out-of-date or more specific - not an overview.

Answered by darkpaw in 828901022

I honestly wouldn't copy an existing project. You need to change so many things that it's easier to just start a new project and copy over any code or assets you want to re-use.

it's also a great opportunity to re-structure and refactor your project to make it more modern or maintainable.

I recently tried to create a new app from an existing one as they shared similar code and structure, but I ended up trashing it because I kept getting errors that files didn't exist, etc.

Accepted Answer

I honestly wouldn't copy an existing project. You need to change so many things that it's easier to just start a new project and copy over any code or assets you want to re-use.

it's also a great opportunity to re-structure and refactor your project to make it more modern or maintainable.

I recently tried to create a new app from an existing one as they shared similar code and structure, but I ended up trashing it because I kept getting errors that files didn't exist, etc.

I tend to agree with darkpaw here. I’m more likely to create a new project for the app and then copy over any source code that I want to reuse in that app. As projects evolve they tend to accumulate cruft, and a new project lets you leave all that behind.

Having said that, duplicating a project isn’t completely unreasonable. If you have automatic code signing enabled then the only thing you should need to change is the bundled ID, in Signing & Capabilities.

But that’s only going to work for simple projects. Any complicated project is going to have additional bits that you need to think about carefully. For example:

  • If your project has app extensions, you need to change their bundle IDs to match.

  • If it’s a document-based app, you need to tweak all the document types.

  • Likewise for URL scheme handlers, icons, App Intents, and many many many other things

The nice thing about creating a new project is that you ‘fault’ these things incrementally, as you notice they’re missing. If you duplicate your project you have to proactively find them all, which is tricky because, if you miss one, you might not recognise that until much later on.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Thank you darkpaw and Quinn. I plan to make a "Lite" version of my app and was afraid that I might mess something up regarding my full app - which isn't selling, arghhh! Oh well, this is a very, very fun hobby. I will follow your recommendations - to create a new app and copy existing code into it. Thanks again!

I plan to make a "Lite" version of my ap

Oh, that suggests another potential path forward, namely duplicating the target within your existing app project. You need to tweak a few things after doing that, but it does bring across the majority of the build settings from the previous target.

If you do this then you need to start thinking carefully about the level of which you set a particular build setting. If you set a build setting on a target, it only affects that target. That makes sense for, say, the bundle ID. But if you have a build setting that you want to apply to all targets, you’ll want to set it at the project level.

For more on this, see the Evaluate how your project inherits settings section of Configuring the build settings of a target.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Overview of steps to create new app from existing one
 
 
Q