Android: Difference between revisions

Leroy (talk | contribs)
m styling
Leroy (talk | contribs)
m Concrete example, relevant to android.
Line 242: Line 242:
=== Android Debug Bridge ===
=== Android Debug Bridge ===


Run <code>nix-shell -p usbutils --run "lsusb"</code> on your terminal to get the list of USB devices connected to your computer. Sample output ([https://stackoverflow.com/a/58594229/437459 source]):<pre>
Run <code>nix-shell -p usbutils --run "lsusb"</code> on your terminal to get the list of USB devices connected to your computer. Sample output:<pre>
...
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 138a:0010 Validity Sensors, Inc. VFS Fingerprint sensor
Bus 002 Device 007: ID 0fce:320d Sony Ericsson Mobile Communications AB Xperia 5 III
Bus 001 Device 008: ID 13d3:3491 IMC Networks
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
...
</pre>
</pre>


<code>ID 1d6b:0003</code> can be seen as: <code>idVendor = 1d6b</code> and <code>idProduct = 0003</code>.
<code>ID 0fce:320d</code> can be seen as: <code>idVendor = 0fce</code> and <code>idProduct = 320d</code>.


<syntaxhighlight lang="nix">
<syntaxhighlight lang="nix">
Line 256: Line 258:
     let
     let
       # nix-shell -p usbutils --run "lsusb"
       # nix-shell -p usbutils --run "lsusb"
       idVendor = "1d6b"; # Change according to the guide above
       idVendor = "0fce"; # Change according to the guide above
       idProduct = "0003"; # Change according to the guide above
       idProduct = "320d"; # Change according to the guide above
     in
     in
     ''
     ''