It’s been a while since I managed it on my mac, I was lucky enough to have a roommate with a windows pc, but here’s what I did (if memory serves)
Working around the instructions from fidelizer’s website you can install homebrew and rkflashtool:
http://www.fidelizer-audio.com/flashing-fidelizer-purist-rom-firmware-on-mac-linux-guide/
&
http://www.fidelizer-audio.com/fiio-x5iii-purist-rom-version-1-2-4-released/
they link to the fiio’s firmware upgrade tool in the second link. this will contain a stock FW 1.2.1 update.img so if you run into any irrecoverable situations before can even make a backup in TWRP you’re going to need to use the steps from the first link, but using the update.img from the second to get back to a fresh base. hopefully you won’t need to.
but anyway the first link and the terminal commands (terminal app found in applications folder under utilities) to install rkflashtool are what’s most necessary.
There’s are two things using rkflashtool that need to be moved to device, (jkbuha if these are out of date please chime in), boot.img from this zip
http://www.mediafire.com/file/wjqivdd2y7pbnl2/boot.zip/file and the TWRP_recovery.img in this zip
https://androidfilehost.com/?fid=1322778262903998941.
Before you power off your device I’d enable developer options in your X5iii, under about device tap on build several times to enable them, and under developer options enable USB debugging.
You connect your player in powered off state to usb connection with your mac, while holding down the previous track rocker. In terminal you can try two commands to see that your device is recognized.
rkflashtool v
rkflashtool n
so you type the below command and after the arrow (with a space after it), I want you to drag the TWRP_recovery.img into the terminal window and then hit enter.
rkflashtool w recovery <
once that finishes do the below command but with the boot.img file being dragged into the terminal window and hit enter
rkflashtool w boot <
you can then type following command then enter
rkflashtool b
to reboot your device. if it boots properly, and still connected to usb, in terminal type below command then enter
adb reboot recovery
and hopefully you should boot into recovery.
you can then move the latest kernel to your device and install/flash the zip in TWRP (as described by the general tutorial/instructions provided by jkbuha)