Volodymyr Vashurkin
macOS Daemonology
Communicate with Daemons, Agents, and Helpers Through XPC
1st ed.
Logo of the publisher
Volodymyr Vashurkin
Dnipro, Ukraine
ISBN 978-1-4842-7276-3 e-ISBN 978-1-4842-7277-0
https://doi.org/10.1007/978-1-4842-7277-0
Volodymyr Vashurkin 2021
This work is subject to copyright. All rights are solely and exclusively licensed by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, expressed or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
This Apress imprint is published by the registered company APress Media, LLC part of Springer Nature.
The registered company address is: 1 New York Plaza, New York, NY 10004, U.S.A.
I owe much to those who have contributed to the software developer in my soul.
Writing this book, I have a heart full of gratitude to:
Apress team, who inspired me to write this book
Sergii Teteriuk, my teacher who helped me become a programmer years ago
the Apriorit company in person of My first tutors, Roman Mokych and Eugene Kordin, for showing me the right vision from the beginning
Oleg Kulchitskyi for his assistance in my wandering through the Darwin Kernel
my parents, Olga and Alexander, who gave me love, unique personal qualities and showed me the way of software development.
Have the courage to follow your heart and intuition. They somehow know what you truly want to become.
Steve Jobs
Without Steves passion and technologies, this book couldnt exist. Thank you and rest in peace.
Table of Contents
Part I: Daemons in a wild
Part II: Daemons in Detail
Part III: Talking to your daemons
About the Author
Vladimir @alkenso Vashurkin
loves the macOS system as well as security development and research. Why macOS? He says, The first two weeks of developing under macOS were hell. The following seven-plus years were heaven.
Vladimir started system and security programming while researching FileVault full disk encryption on macOS and its interaction with iCloud. iCloud uses plenty of system daemons and user agents, so his investigation of Apples infrastructure gave him a solid understanding of how the background world works and piqued his interest in system programming.
Besides system programming, the Darwin kernel and kernel development also found their place in Vladimirs heart. During his work, Vladimir has faced plenty of tricky cases, lack of documentation, and minor and major documentation mistreatments and wants to help people make sense of it all.
In the personal background world (i.e. real world) Vladimir likes extreme sports such as snowboarding, wakeboarding, and motocross. In 2020 he found the best kind of personal transport: the electric unicycle. He loves traveling and exploring the beauties that Mother Nature has gifted us.
About the Technical Reviewer
Mezgani Ali
is a PhD student in transmissions, telecommunications, and artificial intelligence (National Institut of Postes and Telecommunications in Rabat) and a researcher at Native LABs. He likes technology, reading, and his little daughter Ghita. His first program was a horoscope generator in Basic in 1993, and he has done a lot of work on the infrastructure side of system engineering, software engineering, managed networks, and security.
Mezgani has worked for NIC France, Capgemini, HP, and Orange, where he was part of the Site Reliability Engineer (SRE) team responsible for keeping the data centers servers and customer applications up and running. He is fanatical about Kubernetes, REST API, MySQL, and Scala and is the creator of the functional and imperative programming language PASP.
Mezgani has a masters degree in mathematics and computer science from the Research of Superior Institute of Science and Technologies in France; he has a bachelors degree in engineering from XXX in Morocco.
Mezgani is a serious, modest, and relaxed person, and hes always looking for ways to live life by constantly learning new things to improve himself.
Part I Daemons in a wild
Daemons in a wild
Disclaimer: most of the examples and mentionings of macOS as a system with open access to the file system, processes, etc. At the same time, all other devices of the Apple family (running by iOS, watchOS, ) have almost the same internals.
The book could be treated as developers manual for macOS and as researchers guide for the rest of Apple OSes.
Disclaimer 2. All examples and materials of this book are relevant up to its publishing date.
All information is actual for macOS BigSur, Xcode 12 and Swift 5 language.
The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2021
V. Vashurkin macOS Daemonology https://doi.org/10.1007/978-1-4842-7277-0_1
1. Operating System Background World
In this chapter, well explore the operating system background world, comparing what OS shows to the user to what is actually going on behind the scenes.
Behind the Scenes
What do users see when looking at the desktop while doing their jobs?
Most of the time we see nice, shiny applications with rich and pretty interfaces.
These applications may have a single window or multiple ones (Figure ). They show graphics, get user input, and provide output using attractive animations and bright colors.
Figure 1-1
Applications visible to the user (macOS 11.0)