There are some problem when running pcscd on MacOSX. Sometimes my macbook cannot detect the ACR122 driver.

For example, the first time I execute the example in libnfc:

1
2
3
4
5
6
7
8
$ sudo nfc-list 
nfc-list uses libnfc 1.7.0
NFC device: ACS / ACR122U PICC Interface opened
1 ISO14443A passive target(s) found:
ISO/IEC 14443A (106 kbps) target:
 ATQA (SENS_RES): 00 04 
 UID (NFCID1): 0e e9 7e 16 
SAK (SEL_RES): 08

However, the second time I execute it, some errors occur.

1
2
3
4
$ sudo nfc-list 
nfc-list uses libnfc 1.7.0
error libnfc.driver.acr122_usb Unable to claim USB interface (Permission denied)
nfc-list: ERROR: Unable to open NFC device: acr122_usb:253:006

To solve it, we should kill the pcscd process. So..

1
sudo launchctl list | grep pcscd

It shows:

1
9425 - 0x7fcc0582af10.anonymous.pcscd

The pid of pcscd process is 9425, so:

1
sudo kill 9425