Time to update your iPhone SDK to 3.1.3! It's a required update, otherwise Xcode will not recognize or work with your 3.1.3 device. Head on over to the iPhone dev center (developer credentials needed to log in) to download the latest version.
As always, the iPhone SDK includes Xcode, the iPhone simulator, and other tools for developing applications for iPhone and iPod touch. If you want to develop for the iPad, you'll need to join the $99/year developer program and download the 3.2 SDK instead.