Sometimes I need to transfer some music from my PC to my Galaxy S2 and must always activate USB debugging. Then I think, can I keep it ON forever? I mean, Keep it ON for ever can give me a problem (cost battery?) ? And what's USB debugging?
Enabling USB debugging essentially starts up the
adb daemon on your device, which allows it to communicate with
adb on another device to enable debugging commands. It's used when developing and debugging applications, and allows you (primarily) to:
Leaving it enabled all the time will have a negligible impact on battery, if any at all. Some other things to consider about leaving it on (or not):
See also: Using Hardware Devices from the Android SDK documentation which discusses debugging applications on physical devices (rather than the emulator). There is also a documentation page regarding the Android Debug Bridge (ADB) which explains its purpose and its commands.
To make one of eldarerathis' cons less critical:
One could use Tasker or Locale together with the Secure Settings plugin to automatically toggle USB Debugging on for safe locations (based e.g. on cell towers, network/GPS location, WiFi networks connected or in reach), and toggle it off (exit-task with Tasker) when leaving such. With a NFC tag and the Locale NFC Plugin it could also be switched it on/off on demand.
All that even without touching the screen -- so it would work even if the screen is broken. And that "unscrupulous individual" then would have to be in your "safe location" or have your tag, and must know those circumstances -- which is much less risky.
If your device does not belong to that small group having trouble mounting their storage with USB Debugging turned on, this would leave almost no "Con" then.
The biggest downside is not being able to mount it as a mass storage device when you plug it into the computer. With it turned on it will always assume you want to debug the device. You really only need it turned on if you are developing software for the phone or plan on using adb with your phone. The adb program is only available through the Android SDK so its not something average users need. That being said I keep my turned on all the time, but that's only for connivence for doing Android development because I do that more often that use it as a mass storage. You mileage may vary.
You don't have need to keep debugging always on. In some devices it affects the charging of battery. When debugging is kept on, the charging speed becomes very low.... it'll take more than 5 hours to full charge.... if you have such problem then keep off usb debugging, ON it only when you need......