Newsletter # 5 - XPC Services on macOS apps using Swift Oct 18 2019

Hello,

The weekend is here, so before we go get some rest here is this week's newsletter.

Did you see that Ken Thompson's BSD Password was finally cracked? If you don't know who he is, he was one of the creators of the UNIX operating system. Someone found an old(39 years old) /etc/passwd file containing some users and password from the source tree of BSD version 3. And they finally cracked the last password. The article is a fun read. I think you might enjoy it.

This week's post was about using XPC Services in your macOS apps. XPC provides a mechanism to communicate multiple processes. You can modularise your application into small "services" that you can access from your main app. This mechanism has the benefit of code isolation (if the service crashes/killed, your app will be fine). Also, you don't always have to have that code in memory, which reduces the memory footprint. Another benefit is that XPC services have their own entitlements. If you want to read more, here is the link to the post:

https://rderik.com/blog/xpc-services-on-macos-apps-using-swift/

I think XPC is a useful tool, so much so that I'm working on a small zine( https://en.wikipedia.org/wiki/Zine ) that covers not only XPC Services, but also LaunchAgents providing XPC services. Once I have it ready, I'll let you know.

Alright, time for me to get some rest.

Enjoy your weekend,

Derik

Tip of the week:

Use ioreg to check your Bluetooth devices battery percentage.

ioreg(8) is a system administration tool included in macOS that provides access to the IOKit registry. It shows a hierarchical view of the registry.

It provides many flags that help us filter and obtain specific data from our IO devices.

You can use the following command, to get your Bluetooth device battery percentage:

1
$ ioreg -c "NAME OF YOUR BLUETOOTH DEVICE" -k "BatteryPercent" -l | grep -i "BatteryPercent\" =" | awk '{ print $NF}'

There is a lot more information we can get form devices using ioreg. Have a look at the man page ioreg(8) for more details.


** If you want to check what else I'm currently doing, be sure to follow me on twitter @rderik or subscribe to the newsletter. If you want to send me a direct message, you can send it to derik@rderik.com.