<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>day24 — Gerrit Niezen</title>
    <link>https://gerritniezen.com/tag:day24</link>
    <description>Maker of open-source software and hardware.</description>
    <pubDate>Fri, 20 Nov 2026 21:59:25 +0000</pubDate>
    <image>
      <url>https://i.snap.as/aMPXpIot.png</url>
      <title>day24 — Gerrit Niezen</title>
      <link>https://gerritniezen.com/tag:day24</link>
    </image>
    <item>
      <title>A cross-platform approach to accessing Android devices over USB</title>
      <link>https://gerritniezen.com/a-cross-platform-approach-to-accessing-android-devices-over-usb?pk_campaign=rss-feed</link>
      <description>While an Android device can be accessed from Windows over USB, it doesn&#39;t mount with a drive letter, like USB mass storage devices (e.g.,...</description>
      <content:encoded><![CDATA[<p>While an Android device can be accessed from Windows over USB, it doesn&#39;t mount with a drive letter, like USB mass storage devices (e.g., flash drives) do. Well, earlier Android devices used to, but newer ones only support MTP and/or PTP. This means it&#39;s really hard to access them programmatically if you&#39;re developing a cross-platform app and not using the Windows APIs.</p>

<p>A while ago I wrote <a href="https://github.com/tidepool-org/node-mtp">a module for Node.js to access MTP devices</a>, documenting the process <a href="https://gerritniezen.com/using-mtp-on-macos-with-node-js">in</a> <a href="https://gerritniezen.com/using-mtp-on-macos-with-node-js-part-2">three</a> <a href="https://gerritniezen.com/using-mtp-on-macos-with-node-js-part-3">parts</a>. Now, this works great on Linux and macOS, but due to how Windows handles USB devices, the underlying <code>libmtp</code> library works differently under Windows.</p>

<p>If you don&#39;t want to ask the user to navigate to a file on an Android device on Windows themselves, one option would be to automate the task using PowerShell. I&#39;ve taken that approach in the <a href="https://github.com/tidepool-org/uploader">Tidepool Uploader</a>, where I use the <code>node-powershell</code> module to find and download a file from an Android device. It mostly works, but in a small number of cases this approach fails.</p>

<p>This makes me wonder if I can get my <code>node-mtp</code> module working under Windows, even if it means installing a USB driver for the Android device so that <code>libusb</code> can access it. First step: Getting <code>libmtp</code> compiled under Windows using MSYS2/MINGW64.</p>

<p>PS: If you know of a better way to do this, get in touch: gerrit at tidepool.org.</p>

<hr/>

<p>I’m publishing this as part of 100 Days To Offload. You can join in yourself by visiting <a href="https://100daystooffload.com">https://100daystooffload.com</a>.</p>

<p><a href="https://gerritniezen.com/tag:100DaysToOffload" class="hashtag"><span>#</span><span class="p-category">100DaysToOffload</span></a> <a href="https://gerritniezen.com/tag:day24" class="hashtag"><span>#</span><span class="p-category">day24</span></a></p>

<p><i>Comment on this post</i>
<div id="cusdis_thread"></div></p>
]]></content:encoded>
      <guid>https://gerritniezen.com/a-cross-platform-approach-to-accessing-android-devices-over-usb</guid>
      <pubDate>Tue, 19 May 2020 15:37:47 +0000</pubDate>
    </item>
  </channel>
</rss>