How to connect Samsung J7 via USB but disable charging? I would like to know if is it possible to connect my smartphone to a pc via USB without charging it?

It would be very useful to be able to disable charging (but still allow USB tethering, ADB debugging, file transfer etc).

Thanks a lot.
You can try these solutions, which directly address what you are trying to achieve (may not work on all devices)

adb commands from ADB Useful Commands


Adb shell echo 0 &gt; /sys/class/power_supply/battery/charging_enabled (1 to disable; 0 to enable)


adb setprop-persist

Disable USB charging


If these methods don't work or you want to explore more possibilities, see methods below, which can offer you  clues

On your Device:

As suggested by Firelord. Be aware that you would need time in identifying the right file to change values to fool the system. Naming of files related to this is apparently not standardised. One of the answers in the link is mine so I am talking from experience.

You could also see this for another way it has been done https://stackoverflow.com/questions/11698979/how-to-change-android-usb-connect-mode-to-charge-only

On your PC: You have not mentioned your PC configuration, but these have been successfully tried add may give you pointers



https://serverfault.com/questions/8130/configure-usb-port-to-only-act-as-power-source-charger

https://stackoverflow.com/questions/11698979/how-to-change-android-usb-connect-mode-to-charge-only



Modifying the connector hardware (recommended since earlier two options ate Android and Windows version dependent but you would need to try doing the opposite these methods are opposite to your need)


http://www.instructables.com/id/VGA-to-USB-power/
http://www.instructables.com/id/USB-Condom