How do I import existing iPhone app without .xcodeproj file into Xcode

Robs picture Robs · Mar 31, 2013 · Viewed 10.4k times · Source

I have an existing iPhone app (made on a previous version of XCode by a colleague) that I would like to import into XCode. I have the files FirstViewController.h, .m, and .xib files as well as the ones for the other views that were all renamed. I also have the supporting files, such as the sqlite database that is being used, images, the AppDelegate files, and so on. However, I was given all of these files without the .xcodeproj file. I have been trying to recreate the app given all of these files, but to no luck. Can anyone please give me any hints or direction as to how I should try and recreate this app?

Answer

Stuart M picture Stuart M · Mar 31, 2013

If you absolutely cannot get ahold of the original Xcode project file, I would recommend just going through the standard New Project wizard to create a new project, and then import your existing files into the new project. This would involve, at a minimum:

  • Launch Xcode (the latest available version)
  • Create a new project by choosing File menu > New > Project
  • Choose an iOS application project template which most closely resembles your application
  • Follow the rest of the wizard steps to create your project
  • Once you have your new project, import the existing files:
    • For each type of file, right click in one of the file groups in the Project Navigator in the left-hand sidebar and select 'Add Files to …', then follow the prompts to import your file(s)
  • Adjust your code to build properly, using Product > Build and Product > Run as needed.

The iOS App Programming Guide can likely answer a lot of general questions about how to lay out your app structure, set up build settings, etc. Code signing and Deployment Target are two important project-specific settings you'll need to configure, which can be done using the project settings editor by selecting the very top row (where it says your project's name) in the Project Navigator. That should hopefully get you started.