9 ms·
Android developers no longer need Windows USB drivers
- Semaphor 3y agoThat explains it, I was wondering why things suddenly worked. Not just relevant for devs, but also people who want a better and/or more private android experience than what vendors offer.
- 8organicbits 3y agoDo you have a good method for cleaning things up? I usually factory reset any new phone and then uninstall via adb the obvious pre-installed spyware/adware/junk (facebook, chrome, candycrush, etc). But it's hard to know what else I can uninstall. I usually go overkill, uninstall most things, see what broke, factory reset again, and then uninstall a little less on the next round. But surely there's a better way.
- Semaphor 3y agoI unlock the bootloader and install a custom rom (pretty much exclusively LineageOS nowadays, I’d try GrapheneOS, but I’d have to spend far more on the phone than I’m willing to get that). That is everything cleaned ;) I only buy phones with LineageOS support.
- pxeboot 3y agoGrapheneOS is no harder to install or use than LineageOS. If anything, it is easier, since the documentation is far better and almost always applicable to all supported devices.
- Semaphor 3y agoIt’s not about hard/easy, it’s the supported devices. I spend very little on phones (current one is a OnePlus Nord, which I bought for 250€) as I don’t like to use them.
- 8organicbits 3y agoGraphene is Google Pixel only still. The current cheapest available looks like the Pixel 7A at £379 (new). So I agree, the added cost doesn't seem worth it. https://store.google.com/config/pixel_7a https://store.google.com/config/pixel_7a
- Xeamek 3y agoDoes it come with it's own version of the 'core apps' (calendar, phone, calculator etc.) or do You install and use some third party apps from app store?
- Tade0 3y agoYou can install a custom Google Apps package, e.g.: https://nikgapps.com/ https://nikgapps.com/
- Xeamek 3y agoAt that point why would I go for the trouble of installing custom rom though?
- scns 3y agoBecause you can choose how many of them you want. None, only the Play Store or the whole shebang.
- Semaphor 3y agoBesides what sibling said, and lack of bloatware, I find LineageOS to simply be better than original ROMs. Just using vol up/down to move the cursor is already a godsend for me. I’ve also been using CyanogenMod/LineageOS since my first android (HTC Desire Z/T-Mobile G2, damn do I miss that full keyboard) and it’s great to be able to always use the same OS.
- opan 3y agoYou'll get AOSP versions of the basics, though some things like the camera app might actually be made/modified by Lineage. I run LineageOS with no gapps and find it to be quite usable. I get most apps from F-Droid, but there's also Aurora Store (installable from F-Droid) if you need anything from the Play Store.
- tjoff 3y agoOr if you want to use scrcpy, which I find indispensable. https://github.com/Genymobile/scrcpy https://github.com/Genymobile/scrcpy
- yonatan8070 3y agoScrcpy is an awesome tool, but I never found a use for it in my workflow (built a couple of small, unpublished Android apps) What do you use it for that makes it better than just picking up your device?
- sir_brickalot 3y agoI just had a strong use case: a broken screen. A combination of Google Assistant, Talkback, USB-C-to-USB-A-Adapter and Keyboard, a Bluetooth keyboard, scrcpy, Anydesk and a new Pixel phone for practicing helped get some data off the device and even do a migration to the new phone. Needed all of the above and a lot of trial and error and time!!
- mintplant 3y agoI keep a copy of scrcpy around for exactly this. It's saved me twice now, and helped me rescue some data from a friend's phone, too.
- tjoff 3y agoI do most of my meetings on my phone, and enlarging the screen if someone is sharing their screen works pretty well (it's not perfect, but more than enough for presentations). But I can of course transfer the call to my PC if need be. But I just have scrcpy up in a window on one of my screens/workspace constantly. The keyboard shortcuts work quite well and I don't have to break my flow just to do something on my phone. Clipboard is synced as well. If I get a notification I can check what it is about without taking my hands of my keyboard etc. I'm sure it sounds a bit convoluted, and each usecase (meetings, notifications etc.) have other better/more-native solutions but the experience all in all is a game-changer. To the point where "just picking up your device" is too much of a bother. Why not do it through scrcpy instead? Quicker, proper keyboard etc. and the mouse works really well. To the point where I kind of miss right-click is "back" when I'm outside the scrcpy window.
- nodja 3y agoTL;DR: Android only needs winusb to work, before Windows 8 (2012) windows only used Vendor ID and Product ID to decide what driver to load, so you had to install a new .inf driver file for every new device. Newer versions ask the device for a Microsoft OS Descriptors (MOD) payload that tell windows what drivers to load, usually winusb and MTP. The devices need to support this, the author says the pixels started supporting this since the Pixel 2 (2017).
- cylemons 3y ago> windows only used Vendor ID and Product ID to decide what driver to load Even if you plug in standard device classes like HID?
- xenadu02 3y agoNo, Windows has a list of specific "generic device classes" where it will automatically load a generic driver. Mass storage and HID are the primary users of this. But if it doesn't fall into one of those buckets Windows just doesn't enable the device whatsoever. As noted in the article macOS and Linux do the opposite. They allow userspace programs to enumerate unknown USB devices and manually communicate with them.
- cylemons 3y agoHow would userspace programs communicate with usb devices without a driver. Does adb itself on Linux internally contain a driver?
- xenadu02 3y agoOn macOS you open the IOKit device and post/receive messages or use transfer buffers. Only one program can do that at once since the OS doesn't know anything about the protocol, but it works without a driver.
- grishka 3y agoI remember being annoyed at this. However, this was a solved problem a long time ago — sometime after I switched to macOS and stopped paying attention to the Windows side of things, there started appearing universal ADB drivers.
- diggan 3y agoI remember being annoyed at this too, then I stopped doing Android development so I also consider it a solved problem.
- GlacierFox 3y agoI remember being annoyed at the development process in general so I stopped developing and now live in stasis inside a glass egg.
- faitswulff 3y agoDo you happen to have a Nix flake for that egg setup?
- nefarious_ends 3y agoI remember being annoyed in general, but then I ascended beyond human emotions and now exist as a being of pure logic. I make PWAs instead.
- serf 3y agolucky you, personally I just stopped at "I remember being annoyed.", and have been stuck here for years.
- dmarinus 3y agoAndroid should have used HID to have better compatibility with Windows. But I guess the Android developers were on Linux so it wasn't such a big problem for them. Glad it's fixed on Windows now.
- iforgotpassword 3y ago(ab)using hid for anything it's not been designed for usually is a pita, especially if you want decent throughput.
- pjmlp 3y agoThis has been a solved problem for several years now.
- FpUser 3y agoI used raw HID protocol in my USB connected device. This worked on all versions of Windows. Granted it is not suitable for every need but worked just fine for my case.
- jmgao 3y agoIt is especially not suitable for adb, one of the primary use cases of which is pushing a multi-gigabyte system image to the device. You can get 200+ MB/s of real-life throughput with bulk transfers, whereas the theoretical limit of HID is what, 64 kB per millisecond?
- marcodiego 3y agoThe USB driver scene on windows is confusing and sometimes even dangerous. I've seen some students unable to use Arduino clones on windows when they worked perfectly on Linux. I then found this: https://learnarduinonow.com/2014/10/24/does-windows-ftdi-update-brick-your.html https://learnarduinonow.com/2014/10/24/does-windows-ftdi-upd... (TLDR: windows auto-installs a driver that will brick your device if they think it is "counterfeit") and decided plugging something other than a storage device (if you trust the system to be free from viruses) on a windows machine is something that should be done as a last resort only.
- karmakaze 3y agoLink for reference: > Bingxing Wang's awesome driver[0]. Windows Precision Touchpad Implementation for Apple MacBook family/Magic Trackpad 2 [0] https://github.com/imbushuo/mac-precision-touchpad https://github.com/imbushuo/mac-precision-touchpad
- refulgentis 3y agoKarmakaze is very apt ;) — taking the quote, which is a link, and extracting it to a comment with the link "for reference", but really it's to harvest karma from people who didn't read the article
- fragmede 3y agoAnd then, you pointing it out so you can get in on the karma train as well! And then this comment, made just for the points, which are worth so much that I'm trading in my cheap car for a flashy new one next week!
- karmakaze 3y agoAkshully.. it's my way of bookmarking/remembering this for later when I'll want it again And thought it might be useful to highlight (or discuss).
- DiabloD3 3y agoI was using that for years. Apple hates their own customers for not having written that themselves, and forcing us to use some half-assed driver included in Bootcamp that made the whole thing seem state-of-the-art circa Windows 98. That said, my MBPr eventually phased out of Windows support (Intel GPU drivers aged out; more and more apps were losing/removing acceleration features due to (unfixed/unfixable) driver and hw bugs, didn't meet Win11 CPU requirements but ran Win11 fine), it now runs Linux with Waylandized KDE; Linux supports the entire feature set of these trackpads without any work). But yeah, imbushuo is doing some serious work and deserves recognition.
- wkat4242 3y ago
- ineptech 3y agoNo longer, as of when? I was working on this exact problem two days ago, using an old Lenovo M7 for a magic mirror project for a gift. I went through every relevant SO article and gave up without getting it to show up for adb, so it's odd to see this declared a solved problem.
- kllrnohj 3y agoRequires the device to support the extended USB information query. Pixel devices do, at least, presumably your random Lenovo doesn't though for some reason so you'd need a "driver" (even though all the INF does is say "use the standard winusb driver")
- wkat4242 3y agoI really love adb. It's so damn useful. You can even reroute ports through a VPN running on the phone. It's like a swiss army knife. And I'm not even an android developer lol It's one of the biggest reasons I prefer android. That and the work profile that allows me to compartmentalise all work stuff and other privacy invading shit without needing a second phone.
- dotancohen 3y agoTell us more about this work profile. Is this on all Android phones?
- vetinari 3y agoIt should be nowadays; but to provision it, you need MDM. https://www.android.com/enterprise/work-profile/ https://www.android.com/enterprise/work-profile/
- lern_too_spel 3y agoNot necessarily. https://github.com/googlesamples/android-testdpc https://github.com/googlesamples/android-testdpc https://gitea.angry.im/PeterCxy/Shelter https://gitea.angry.im/PeterCxy/Shelter https://secure-system.gitlab.io/Insular/ https://secure-system.gitlab.io/Insular/
- vetinari 3y agoNice, thanks!
- wkat4242 3y agoNo you don't! You can just use the island (or insular) app to leverage it for your own purposes
- tripdout 3y agoTestDPC is even simpler/lightweight
- inemesitaffia 3y agoI've been using wireless adb since 4.4
- jmgao 3y ago> Going through my personal collection of Pixels, MODs support seems to have started between Pixel 2 (2017) and Pixel 3a (2019) (sorry, I don't have a Pixel 3 to test). This definitely would have made it to Pixel 3, per the commit message (https://android.googlesource.com/platform/system/core/+/db64696b7cbe632772d9851ed427f3465e07c7ae https://android.googlesource.com/platform/system/core/+/db64...), it was my primary development device when I implemented this :-) Everything that's CTS-compliant that got Android 11 should have support: the only change needed from the OEM would be to write a 1 to /config/usb_gadgets/g1/os_desc/use in their USB HAL and there's a CTS test to make sure they did so.
- fabiensanglard 3y agoNo idea you implemented it. Thanks a lot for that!
- kelnos 3y agoGreat, so it looks like this requires phone manufacturers to add Microsoft-proprietary garbage to the USB descriptors. Instead of just having Windows do something sane like Linux and macOS do, and fall back to a standardized userspace interface. Dumb.