There are basically two things we were doing to avoid that:
- Keep your test devices in a cool dry place, preferable a server room with temperatures between 16-18 Degrees celsius
- Do not keep the device constantly connected to a power source. Of course this would be an impossible task without an automation. We were using Acroname programmable usb hubs, which could cycle usb power according to the given schedule.
In general, mobile devices are not created for this type of workload, and the best way to workaround the described issue would be to completely remove batteries from them and connect them directly to a power source. Although, it would be a completely different story. Also, some phones have special controllers inside of their batteries, so one would have to mimic these when using batteryless connections.