Connected MCU device path determination for macOS and Linux

Latest Release: 0.2.1

 New Version

 

About dlist

dlist (dee-list) is a macOS/Linux CLI utility that lists MCU boards, such Raspberry Pi Picos. and USB-to-Serial adaptors connected to your computer. It can be used for informational purposes and to pipe a device’s path into other CLI tools, such as serial comms utilities. It is written Swift.

Quickly get the device paths of connected MCUs

How to Use dlist

Run dlist to get a list of connected MCUs.

If only one board is connected, its path within the /dev/ directory will be provided. On macOS, for example:

$ dlist
/dev/cu.PL2303G-USBtoUART10

The device file path is issued to STDOUT so that it can be passed into other commands. For example:

minicom -D $(dlist) -b 9600

If multiple MCUs are connected, dlist will return a numerical list:

$ dlist
1. /dev/cu.PL2303G-USBtoUART10
2. /dev/cu.USB-MODEM-001

This list is issued to STDERR, so it’s printed in a terminal but will typically not be passed to another program. This allows you to select which item you then wish to use. For example:

$ dlist
1. /dev/cu.PL2303G-USBtoUART10
2. /dev/cu.USB-MODEM-001

$ minicom -D $(dlist 2) -b 115200

Including a numerical argument causes dlist to issue the specified device (by its index in the list) to subsequent commands through STDOUT.

If there is only one MCU connected and you still specify a value but one that is not 1, this will generate a warning on STERR but will still issue the single device’s path. If there are multiple devices connected, specifying an invalid index number will throw an error.

Options

Including --info or -i as a dlist argument will force it into list mode, however many devices are connected.

$ dlist -i
/dev/cu.PL2303G-USBtoUART10    [Board in FS mode, MicroPython]

Because the output is intended to be readable by people, it is not suitable for piping into another command. Make sure you don’t include the flag if you’re using dlist to pipe the device path.

Ignorable macOS Devices

macOS adds a number of standard devices to the /dev/cu.* set, none of which can be used for USB-to-serial roles. dlist ignores these. However, macOS may also add other devices which cannot be known at compile time. For example, after I have connected my Beats Solo Pro wireless headphones to my Mac, they can appear in /dev/ as cu.SmittytoneCans based on the name I gave them. I can’t know what your wireless headphones are called, so dlist now reads a list of ignorable devices from ${HOME}/.config/dlist/ignorables. Add the extra devices you want dlist to ignore there, on a one-device-per-line basis.

Install dlist

macOS

  • Clone the source repo, https://github.com/smittytone/dlist
  • cd /path/to/repo
  • git submodule update --init --recursive
  • Open the .xcodeproj file
  • Set your team under Signing & Capabilities for the dlist target
  • Select Archive from the Product menu
  • In the Archives window, select the new build and click Distribute Content
  • Follow the sequence, choosing Custom and Build Products, and save the output to the Desktop
  • sudo cp /path/to/exported/dlist/binary /usr/local/bin/dlist

Linux

  • Install pre-requisites: sudo apt update && sudo apt install pkg-config libudev-dev libusb-dev libftdi-dev
  • Install Swift
  • Clone the source repo, https://github.com/smittytone/dlist
  • cd /path/to/repo
  • swift build -c release

Note On the Raspberry Pi 5, the build process and running dlist will emit swift runtime: unable to protect... disabling backtracing messages. To avoid these, you can add the flag --static-swift-stdlib. The quid pro quo is that it may start up more slowly and will be a much larger build. An alternative approach is to add export SWIFT_BACKTRACE='enable=no' to your shell profile file. This removes the messages, keeps the binary size low, but of course disables Swift’s improved crash reporting.

The Linux binary will be located in .build/{architecture}/release/

Note The script bump.sh, used in dlist development, currently only runs on macOS.


Source Code

You can view Dlist’s source code at GitHub.


Release Notes

  • 0.2.1 15 December 2025
    • Handle ignorable devices on macOS that are prefixed in the list with /dev/.
    • Remove unnecessary Linux build instruction.
    • Fix build warnings on Linux.
    • Update to clicore 0.3.0.
  • 0.2.0 22 August 2025
    • Sync project code with my other CLI utilities.
    • Improve build bumping.
  • 0.1.5 8 August 2025
    • Initial public release.

Related Software


smittytonesmittytone
Site and software copyright © 2025, Tony Smith