I have an app on the store for which I want to start rewriting the entire application \"from scratch\". When I try to build and execute the new app on my device (iPhone 4) w
I believe the issue has to do with the App's provisioning.
The version of the app on your device, downloaded from the App Store, has been signed with a Distribution profile. When you build from Xcode and try to install over it you are using a Development profile and trying to attach the debugger.
Based on my experience you can not overwrite an App Store app signed with a Distribution profile if you build from Xcode using a Development profile and try to install over the App Store app.
Try building from Xcode using a Distribution provisioning profile and without attaching the debugger.
Also, people will never experience this kind of error when upgrading their app in the App Store because both provisioning profiles are required to be a Distribution profile.