Monday, October 20, 2014

battery life - What is USB debugging? Can I keep it ON forever?


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?



Answer



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:



  • Transfer data between a computer and your device (both ways)

  • Read log data easily from logcat

  • Debug applications, including breakpoints and heap monitoring

  • Install and uninstall applications

  • Access a stripped-down shell on the device, for command-line interaction.



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):



  • PRO: If your device has a hardware problem that prevents you from accessing the screen, USB debugging could be helpful in recovering data (especially on a rooted device).

  • PRO: You can install applications, reboot your device, and generally do some other convenient things without having to actually interact with your device physically, even with the screen locked/off.

  • PRO: On a rooted device it may be possible to regain entry if you have forgotten the screen lock password/pin/pattern (also a potential CON, see below).

  • PRO: You can take advantage of port forwarding over USB debugging to use tethering apps like PDANet (I believe that's how it's implemented since it does require it).

  • CON: If your device is lost or stolen, an unscrupulous individual could attempt to steal data from the device regardless of whether or not you've got a screen lock. If you're rooted, they can get pretty much everything.

  • CON: I recall reading that some devices can have trouble with accessing the SD card as a mass storage device when USB debugging is enabled. I've personally never seen this issue, but I have seen people allege that it was a problem.



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.


No comments:

Post a Comment

samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...