Status Update
Comments
jo...@gmail.com <jo...@gmail.com> #2
with options like:
Never (Default)
Always
When charging
When ADB is connected
pa...@gmail.com <pa...@gmail.com> #3
There's a possible workaround while we wait a few years until this reaches the wide market, if at all:
(there's also a bit of ranting about other non-viable options :)
ta...@gmail.com <ta...@gmail.com> #4
ki...@gmail.com <ki...@gmail.com> #5
ba...@gmail.com <ba...@gmail.com> #6
ch...@gmail.com <ch...@gmail.com> #7
Thanks :)
ss...@google.com <ss...@google.com>
en...@google.com <en...@google.com> #8
bo...@gmail.com <bo...@gmail.com> #9
ac...@gmail.com <ac...@gmail.com> #10
xa...@google.com <xa...@google.com>
bo...@google.com <bo...@google.com>
bo...@google.com <bo...@google.com> #11
na...@google.com <na...@google.com>
er...@gmail.com <er...@gmail.com> #12
So now that we have wireless ADB we have a new problem. Now the screen goes off while having ADB connected, which makes the whole wireless debugging kind of pointless. I could work around that by charging the device, but that kind of makes this pointless.
Would be great if Google could do something about this to improve the developer experience on our daily devices. :)
ea...@google.com <ea...@google.com>
ma...@marcardar.com <ma...@marcardar.com> #13
This proposed setting would be better anyway (regardless of WiFi debugging) because you probably don't want to keep the screen on while charging with a wall charger.
sh...@google.com <sh...@google.com> #14
Since the former is indeed applicable to wireless debugging, however legacy(USB) users will relate to the latter. Also, hardware engineers as well as UX engineers engaging in display work (e.g motion-to-photon) might want a screen/power control (without needing adb functionality).
The change request is doable (from a cursory point of view), however I'd like clarity on this aspect.
>>screen goes off while having ADB connected, which makes the whole wireless debugging kind of pointless
When the screen goes off, does the device disconnect? (I'd be very surprised if it did).
Why do you qualify this as "pointless"? (since the Android system is entirely accessible over adb)
ma...@marcardar.com <ma...@marcardar.com> #15
I would guess the primary motivation (for developers) to "Keep screen on" is for debugging purposes and that debugging has a much higher correlation with being connected to ADB than with charging. Consider many developers charge devices while sleeping, but aren't capable of debugging while sleeping. I'm pretty sure legacy(USB) developers will understand the concept of "Keep screen on while adb is connected".
I suppose, as you mention, there are niche cases where some people would like the screen to "stay awake while charging" but I would guess this group is insignificant compared to regular users who do not want this. Consider a location with power cuts, where the power comes back on, automatically turning the screen on, but then it stays on because of the setting. Also consider when plugging in before going to sleep. At the moment you have to remember to turn the screen off manually.
I suppose you could support both. Perhaps a dropdown of "When connected to ADB", "When charging", "Never". Perhaps you want to separate wired/wireless charging too. Personally, I have no use for a "when charging" setting if I have the "when connected to ABD".
pa...@gmail.com <pa...@gmail.com> #16
+1 on #15
sh...@/#14 have a look at my analysis of possibilities for more motivation (it's long, but exhaustive):
Why do you qualify this as "pointless"?
Because when you use wireless debugging, and you want to keep the screen turned on, you have to plug in your phone to keep the screen on, therefore it's not "wireless" anymore. 🙄
(We moved from having to be plugged in to the computer to having to be plugged in to a power socket, which is a bit more lenient, but still an unnecessary restriction to use this feature.)
er...@gmail.com <er...@gmail.com> #17
So, are you asking for an other setting "Keep screen on while adb is connected", in addition to the 'Stay awake' (Screen will never sleep while charging) setting?
Yes, that sounds like a good solution. Add another option in the developer settings, or make this setting a dialog where you choose between "Off", "While charging", and "While ADB is connected".
Since the former is indeed applicable to wireless debugging, however legacy(USB) users will relate to the latter. Also, hardware engineers as well as UX engineers engaging in display work (e.g motion-to-photon) might want a screen/power control (without needing adb functionality).
My experience is that developers working on the lower levels as yo mention will usually not have the full Android system running anyway, so it seems pointless to have developer settings catering their needs, but I might be wrong?
However, there are Android devices today where I might have a USB connection for ADB which doesn't charge the device. This is very common for development boards. In these cases, the setting we have today doesn't help at all (i.e., the device might not be charging even if we have ADB connected over USB).
When the screen goes off, does the device disconnect? (I'd be very surprised if it did). Why do you qualify this as "pointless"? (since the Android system is entirely accessible over adb)
No, the device doesn't disconnect, but since the app I'm working on ends up behind the lock-screen, regular app development where we mostly work on UI becomes disrupted when the screen lock kicks in.
sh...@google.com <sh...@google.com> #18
>>I suppose you could support both. Perhaps a dropdown of "When connected to ADB", "When charging", >>"Never". Perhaps you want to separate wired/wireless charging too.
Interesting thoughts - esp the wireless charging part.
I agree wrt dev boards (without a battery) potentially not consistent with the general case, however we *expect* platform developers (and OEM integrators) to understand the philosophy behind settings. True, we can have a custom (subset?) settings however it will not be viable (from a cost-benefit perspective).
BTW, OTA would cause the wake lock to force the screen to stay on (yet, I don't see users getting confused about the seeming anomaly wherein the screen stays on - even while not charging).
>>No, the device doesn't disconnect, but since the app I'm working on >>ends up behind the lock-screen, regular app development where we >>mostly work on UI becomes disrupted when the screen lock kicks in
This is more of a lock-screen usability question, isn't it? What's to prevent the system from even killing your process (OOM for e.g) if the system feels there's no need to spend cycles on a locked (or display off) Android? (rhetorical question).
Will discuss these options, from the developer exp point of view.
sh...@google.com <sh...@google.com> #19
Although 100% of Android developers know (and use adb), they constitute only 0.001% of the general population (who would know what a screen is && do not want to (rightly so) know *what adb* is/does :)
So, replacing the verbiage would be a disservice, IMO.
da...@gmail.com <da...@gmail.com> #20
I hope this point is not to say we shouldn't do the ADB thing. This setting is in developer settings and requires knowing about the secret menu to enable developer settings, so the full Android userbase shouldn't be in consideration for this issue, IMO, even if non-developers use some of the settings.
I do think different options would be nice/helpful for both cohorts.
sh...@google.com <sh...@google.com> #21
This would help in characterizing the problem accurately.
yo...@gmail.com <yo...@gmail.com> #22
ta...@gmail.com <ta...@gmail.com> #23
se...@google.com <se...@google.com> #24
@sh...@google.com what these folks are talking about is related to packages/apps/Settings/src/com/android/settings/development/StayAwakePreferenceController.java
I do agree that the use cases in which I want my phone screen to stay on when not connected to ADB are zero. I leave this setting on since I do want it to kick in when I am developing on the device, but it's a (minor) nuisance whenever I am not using the device for development.
pa...@gmail.com <pa...@gmail.com> #25
#16: Is 'Disable screen lock' really deprecated?
I couldn't find such an option on my Pixel 7 Pro. Then I did a quick research, and I think the question pertains to this disappearing act (last image on both pages):
- Android 2.2:
https://www.coolmuster.com/uploads/image/20181012/enable-usb-debugging-android-20.jpg fromhttps://www.coolmuster.com/how-to-enable-usb-debugging-mode-on-android-devices.html - Android 2.3:
https://images.wondershare.com/article/2016/03/14586018625078.jpg fromhttps://tunesgo.wondershare.com/android/enable-android-developer-options.html
So by the looks of it, the SO question is talking about the disappearance of the option we're talking about here. I think the quotes there are more for "paraphrasing".
Although 100% of Android developers know (and use adb), they constitute only 0.001% of the general population
Agree with #20, the fact that this is in "Developer Options" section of the Settings app which needs to be explicitly enabled as an easter egg, I would think that replacing the verbiage would be of service to those 0.001% of users who are the target audience. By the way, the wording can be generalized, it doesn't need to say "ADB", if the additional option is added, then "Screen will never sleep while developing/debugging" description would not confuse the general population much, but then it may require explanation for developers what it does exactly.
This is more of a lock-screen usability question, isn't it?
The lock-screen kicks if after there's nothing keeping the device awake for a period of time. While debugging (literally stepping through code) there's a lot of time passing. Imagine that you're trying to debug Activity lifecycle and then the screen just goes off, meaning your state and lifecycle is gone. Or you're running UI tests over WiFi and the lock screen just kicks in breaking your test suite's ability to tap on the app.
but it's a (minor) nuisance whenever I am not using the device for development.
I would classify it as a big enough problem, considering the number of upvotes (307 here alone, hundreds more in different places scattered around the web, asking for the same thing). It also has monetary value to the developers whose screens are destroyed (burn-in) because of this setting.
sh...@google.com <sh...@google.com>
tm...@google.com <tm...@google.com> #26
Cipson, this is a public issue, let me reroute to you first.
yo...@gmail.com <yo...@gmail.com> #27
A workaround on macOS:
Put this in a shell script and run it.
#!/usr/bin/env zsh
allDevices () {
devices=$("${ANDROID_HOME}"/platform-tools/adb devices | grep "device$" | cut -f1)
[[ -z $devices ]] && echo "No Devices"
devArray=("${(ps:\n:)${devices}}")
for device in "${devArray[@]}"
do
echo "Device:" "$device"
"${ANDROID_HOME}"/platform-tools/adb -s "$device" "$@"
done
}
while true; do
allDevices shell input keyevent KEYCODE_WAKEUP
sleep 5
done
This will keep the screen on while it is connected to adb
.
Description