Phones which battery doesn't get swollen?
I do lots of testing of apps in real phones, not emulators.
The thing is that the phones must be connected to the PC all day. Because of this, phones battery get swollen and I have to buy phones regularly.
Do you know any android phone which can be connected and on all day all week without getting swollen after a time?
Must be real phones, emulators are descarted.
I'm not sure but i think i heard there was a solution for some rooted phones to stop charging at a specific battery level (magisk Module maybe?). Similar to al dente on a mac. Maybe you could look into that
Android can do that by itself these days; at least LineageOS can.
Lineage and some vendor ROMs like OneUI can. Pixels can't.
https://support.google.com/pixelphone/answer/6090612?hl=en
"To protect your battery health and help extend its lifespan, your phone automatically limits charging to about 70%-80% under certain conditions, such as: Continuous charging for more than a few hours under high temperatures. Continuous charging for more than several days."
That's behavioral recommendations, not a setting in the phone.
It's not a setting because it works automatically. You don't need a switch to toggle this behaviour. It's always on.
He wouldn't need the setting if he's leaving the phone plugged in all the time.
But that's why they need the setting, because they are leaving it plugged in all the time.
Does the Fairphone still boot with the battery fully removed? If so, that might be an idea!
The best way to prevent swelling is stop charging at 80% or less (some phones have this feature, or you can use homeassistant with a smart plug), and keep the phone cool below 21C/70F.
Stop constantly charging the battery all day.
Some phones today do have some battery management to prevent overchargring, but it's fairly limited.
Does the USB spec permit data-only cables (that is, without the power wire)?
No, it's a fundamental flaw of lithium ion batteries and I don't think you'll find any recent phone that doesn't use a lithium-ion battery.
I never used this, but my motorola g42 has this feature
Well, you can't prevent that entirely, it's a chemistry thing.
But you can change how android connects, and/or use a cable that doesn't charge but only does data. You used to be able to find such cables anyway, I haven't looked in a while. I'm fairly sure that you could modify a cable if you're already capable of app testing.
Not likely as a swollen battery is a sign of a fault happening but not catastrophic yet.
Another option is a phone with a replacement battery so if the battery goes switch the battery and keep the phone going.
What about if you remove the battery and keep the phone connected?
I think this might work with some phones but I tried this with my old Note 4 and it won't work without the battery terminals on the phone reading some nominal voltage. I had planned to use it as a screen to control my 3D printer and after it didn't work initially, did some googling and saw suggestions about newer phones being able to run without a battery (though no specific models given). The Note could work as well with something like a buck converter attached to the pins and powered separately.
I think Sony phones have an option to use charging power directly, without going through the battery.
You could try the OnePlus 12R. The marketing claims 80% peak capacity after 4 years. But, I would instead buy a smart plug which only turns on for two hours every 12 or 24 hours. That way you only do one possible charge every day. Plus, use any limit battery charge function present on the phone(samsung, OnePlus, realme, vivo, etc)