i able duplicate entire xcode project, rename project , associated files without xcode going mental, , without having manually re-import files project.
this answer culmination of various other stackoverflow posts , tutorials around internet brought 1 place future reference, , else may facing same issue. credit given other answers @ end.
duplicating xcode project
in finder, duplicate project folder desired location of new project. not rename .xcodeproj file name or associated folders @ stage.
in xcode, rename project. select project navigator pane (left pane). in utilities pane (right pane) rename project, accept changes xcode proposes.
in xcode, rename schemes in "manage schemes", rename targets may have.
if you're not using default bundle identifier contains current product_name @ end (so update automatically), change bundle identifier new 1 using duplicated project.
renaming source folder
so after following above steps should have duplicated , renamed xcode project should build , compile successfully, source code folder still named in original project. doesn't cause compiler issues, it's not clearest file structure people navigate in scm, etc. rename folder without breaking file links, follow these steps:
in finder, rename source folder. break project, because xcode won't automatically detect changes. of xcode file listings lose links actual files, turn red.
in xcode, click on virtual folder renamed (this right @ top, under actual .xcodeproject) rename match name in finder, won't fix , strictly isn't required step it's nice have file names matching.
in xcode, select folder renamed in navigation pane. in utilities pane (far right) click icon looks dark grey folder, underneath 'location' drop down menu. here, navigate renamed folder in finder , click 'choose'. automagically re-associate files, , should no longer appear red within xcode navigation pane.

in project / targets build settings, search old folder name , manually rename occurrences find. there 1 prefix.pch , 1 info.plist, there may more.
if using third party libraries (testflight/hockeyapp/etc) need search 'library search paths' , rename occurrences of old file name here too.
repeat process unit test source code folders project may contain, process identical.
this should allow duplicate & rename xcode project , associated files without having manually edit xcode files, , risk messing things up.
credits
many given nick lockwood, , pauly glott providing separate answers problem.
Comments
Post a Comment