ios - Run old build in Xcode debugger


Keywords:ios 


Question: 

I'm trying to debug some migration code in my app that runs only when the app is updated (by checking if CFBundleVersion has changed since last launch). My code being versioned with git, my current workflow is :

  • checkout to previous release
  • build & run
  • close the app (home button)
  • checkout current code
  • build, run and test

The problem is that it takes quite some time, and I usually have to close the project between checkouts because it creates conflicts if the project configuration has changed.

What I would like to do is to build the two versions of my app once and for all, and run them alternatively in the debugger. There is an option 'Run Without Building' under the Product menu in Xcode, but there is no way to chose what is run, and it's always the last build.


1 Answer: 

I would use two directories: 1. for old app (same git repo, but on some past commit) 2. for current app (again same git repo, current version)

Open xcode twice, with each project. You don't need to do this switching at all. For testing this is good setup I am using.