Just a small tip here, occasionally when right in the middle of development I’ve come across this crazy looking error:
Error launching program: Failed to get the task for process XXXX.
The program launches on the iPhone, blinks and then as disappears. Very worrying. In my case it was because I’d left the build to ad-hoc, switching to debug fixes it straight away. Very odd it would even try and launch though!
Although XCode is not the worst IDE in the world, it is definitely buggy.
Countless times I have come up against a bug, almost always to do with provisioning profiles, build failures or sync issues which make no sense whatsoever. To prevent you banging your head constantly against a wall, when a problem seems totally illogical I always take these steps.
- Stop the app
- Delete from the device / simulator as appropriate
- Restart XCode
- Clean all builds
- Pray
If that doesn’t work:
- As above
- Restart Mac
- Restart iPhone
Trust me, more often than not that will fix all sorts of problems.