Today I imported an iOS project, originally written in Xcode3 into Xcode4. I ran into an issue that prevented me from debugging the app both in the iOS Simulator and on my own iPhone 4. When hitting ‘Run’, all Xcode would do is show the message “Attaching to MyApp”. The simulator and my iPhone both didn’t do anything, the app didn’t even get installed on the devices. The solution is quite simple. Xcode4 is a bit picky about the name of your project.
- Go to Project > Build Settings
- Search for “Product name”
Here you’ll find the names for the debug en release versions of your app. Now compare those the name of your project. Here’s what I found:
- Project name: myapp-iphone
- Product name: Multiple values
- Debug: MyApp-DEV
- Release: MyApp
The solution to the “Attaching to MyApp” problem is very easy. Simple update the “Product name” value to
$(TARGET_NAME). After that, clean your app by pressing
⇧⌘K. Now, when you press ‘Run’, your app should start as you’d expect.