After upgrading my 3Gs to iOS 5, Xcode would not recognize my iPhone for development. It just listed my phone with the old version of the iOS, not connected. After updating Xcode through the app store, (which does not actually update Xcode, you have to find and run the installer in your Applications directory) Xcode would still not recognize my phone as connected.
However, after I opened up iTunes and iTunes gave me the message, “You phone is locked with a passcode” and I unlocked my phone and went back to Xcode it worked fine.
I just wanted to share that weird solution with everyone.