how to detect if my app was launched from xcode after compilation or from package bundle downloaded from itunes?
The code below does not seem to work, given that the else block always gets executed when I build and run it from xcode.
#if (TARGET_OS_SIMULATOR)
#else
//Xcode did not launch this app
#endif
TARGET_OS_SIMULATOR
test is just testing if this was built for the simulator. It has nothing to do with how it's launched. Generally speaking, the right answer here is a build configuration, not a "I was launched from Xcode" test.