I have such a problem. I used Xcode 3.2.5 earlier then I have installed 4.1 Xcode into Developer folder, so my Xcode 3.2.5 was automatically removed to Xcode 3.2.5 folder. So I was a happy iOs developer with 2 Xcodes. But then I decided to install Xcode 4.2( into Developer folder too). First time no any Xcode could be launched. After reboot everything became ok. Except this:
CodeSign build/Debug-iphoneos/MyTest.app
cd /Users/alexslabinsky/Desktop/MyTest setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" setenv _CODESIGN_ALLOCATE_ /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin/codesign -f -s "iPhone Developer: Alex Slabinsky (NUMBERS_here)" --resource-rules=/Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app/ResourceRules.plist --entitlements /Users/alexslabinsky/Desktop/MyTest/build/MyTest.build/Debug-iphoneos/MyTest.build/MyTest.xcent /Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app
/Users/alexslabinsky/Desktop/MyTest/build/Debug-iphoneos/MyTest.app: object file format invalid or unsuitable Command /usr/bin/codesign failed with exit code 1
I tried almost all what could find here and by Google.com but nothing helps. Please, help me. Thanks.