Inspired by
@ErikHellman@twitter.com
complaining that there should be an Android developer option called "Keep screen on while ADB is connected", I hacked up a quick prototype app to do just that.
The app uses a NotificationListenerService to check for the presence of the "USB debugging connected" or "Wireless debugging connected" notification. When an ADB connection is detected this way, a WakeLock is acquired to prevent the screen from turning off. The WakeLock is released when the screen is manually turned off and re-acquired when the screen is turned back on.
The feature request (from 2016) to include this functionality in Android can be found here:
https://issuetracker.google.com/issues/37094654
The #coffeine #tile is just for that in #lineageos : it keeps screen on, very handy for app development.
Additionally, I sometimes use #scrcpy