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 shell echo 0 > /sys/class/power_supply/battery/charging_enabled (1 to disable; 0 to enable)
If these methods don't work or you want to explore more possibilities, see methods below, which can offer you clues
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
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)
Yup, you should be able to use the adb command. Or use an app I just released to disable usb charging in Android phone. Has not been tested on Samsung j7 though.
It needs root access.