Better Updates Please

The few patch updates to macOS Big sur recently have pretty much confirmed that Apple’s promise of faster updates when using macOS Big Sur is not exactly accurate. Apple’s statement was essentially that if you have automatic updates enabled, the process to install the update will be done in the background and you will be prompted to restart once that operation is complete (saving you time). The problem with this is that I don’t have automatic updates enabled as the quality of macOS updates this past year (Catalina) have caused multiple issues and re-releases have been frequent to fix issues caused by the updates....

Handling Flaky Tests

When running tests, sometimes you may discover that some tests just fail sporadically. This may be due to conditions on the test host or perhaps some unexpected downtime in a service. It could even be caused by using test randomization. Regardless of the cause, the goal is to have all tests passing at all times and that does become difficult if there are external dependencies or resource issues. XCTest provides some utilities to help us make robust tests that can handle this....

Signing Requests

When sending requests to a server, you do not want a malicious actor to tamper with the payload and try to change what the server should do. To add a layer of security to the request, you can add a cryptographic digital signature to the request headers (encoded with Base64). For iOS devices, ECC is preferred and the generated keys can be stored in the secure enclave. Using these technologies, requests can be protected with ECDSA....

TLS Pinning with ATS

TLS pinning can be difficult to get right in code. Luckily, Apple has a new feature in App Transport Security (ATS) that makes pinning certificates much easier. In an application’s Info.plist, new configuration can be added to NSAppTransportSecurity in the form of a dictionary with the key NSPinnedDomains. In this dictionary, you create additional dictionaries with the key being the particular hostname of the server you are connecting to. ATS allows you to pin the certificate authorities (CAs) as well as the leaf certificate using SHA-256 BASE64 encoded SPKI fingerprints....

Embedding Debug Symbols in XCFrameworks

When creating and distributing a binary, a dSYM and BCSymbolMaps are generated (if Bitcode is enabled) and these artifacts contain debug information about the code you just compiled. Prior to Xcode 12, when creating an XCFramework, these additional files needed to be distributed separately or manually added into the XCFramework. Now, xcodebuild has a new option when executing the -create-xcframework command: -debug-symbols. However, the use of this option is not straightforward....