USB SMART CARD READER DRIVERS
OS X has a builtin list of supported USB CCID class-compliant smart card readers. For other readers, install the reader driver in /usr/libexec/SmartCardServices/drivers. Each driver is a bundle.
See also USB - CCID compatibility matrix
The bundle contains an XML file Info.plist which contains the device’s USB vendor ID and product ID. For detailed description of plist format and how to write driver, see <http://pcsclite.alioth.debian.org/api/group__IFDHandler.html>
with macOS Mojave (10.14.6) it is still possible to install your own version of libccid or other PC/SC IFD Handler bundles to /usr/local/libexec/SmartCardServices/drivers.
Drivers are loaded as dynamic library from the latter one
Using unified Logging on macOS platform
SMART CARD APDU LOGGING
It is possible to turn on logging for smart cards. Logging is turned on by setting global preference:
After a smart card reader is connected (or after reboot) all operations including contents of sent and received APDU messages are then logged into system log. Logging uses facility com.apple.security.smartcard.log so it is possible to set up filtering of these logs into custom targets (see asl.conf(5))
Note that logging setting is one-shot; it must be turned on by the command above to start logging again with a new reader. This is to avoid security risk that logging is turned on indefinitely.
So, set this value to yes, plug in your AirID via USB and you should see APDU tracing. After the AirID is unplugged from USB, APDU tracing is disabled again.
Customizing Logging Behavior While Debugging
Logging behavior is normally governed by the system. However, while debugging in macOS, you can enable different logging levels for a subsystem using the
log command-line tool’s
config argument while logged in as root.
This shows how to enable debug-level logging for a subsystem.
Enabling debug-level logging for a subsystem
$ sudo log config --mode "level:debug" --subsystem com.your_company.your_subsystem_name
Logging PC/SC or IFD Hander activity
This is the script I use normally to debug PC/SC under macOS Mojave
On my machine this leads to the following logging
Getting information from com.apple.bluetoothd
Getting information from blued (does not exist on catalina)
Getting information from system_profiler
Was this answer helpful?
Please rate & help us to improve our FAQ.