Install Xcode Command Line Tools

Need to install Xcode Command Line Tools? You’re probably here because you ran git, clang, or another development command and got an error saying the command wasn’t found. The command line tools are essential for iOS development, even if you’re not using the full Xcode IDE. Here’s how to get them installed quickly. Install via Terminal (Recommended) The fastest way is using Terminal. Open Terminal and run: xcode-select --install This triggers a popup dialog asking if you want to install the command line developer tools. Click “Install” and wait for the download to complete. ...

How to Control the Status Bar in iOS Simulator

Need to quickly change the iOS Simulator’s status bar for screenshots or testing? You can do it with the simctl command-line tool. Here’s a quick look. The Basic Command The core command to manipulate the status bar is: xcrun simctl status_bar <device> override <options> <device>: Use booted for the currently running simulator, or a specific simulator UDID (get a list with xcrun simctl list devices). <options>: These are key-value pairs for what you want to change. Common Status Bar Overrides Here are some of the most common things you’ll want to do: ...

How to Record GIFs from iOS Simulator

Creating GIFs from your iOS Simulator is a great way to showcase features, document animations, or report bugs. Let’s look at the easiest ways to do this. Record a GIF from the iOS Simulator The simplest way to record a video of your app running in the iOS Simulator is using its built-in screen recording feature. Launch your app in the iOS Simulator. With the Simulator window active, go to File > Record Screen in the macOS menu bar, or press the shortcut Cmd + R, or hold Option and click on the record button in the Simulator’s title bar. A recording indicator (a small circle) will appear in the Simulator’s title bar. Perform the actions you want to capture. To stop, click the recording indicator again, or press Cmd + R. A thumbnail of your recording will appear. Right-click that recording then select Save as Animated Gif. ...

Xcconfig Explained

Xcode project files can get messy as projects grow in size and complexity. The complexity is increased when there are multiple environments or configurations, each with unique settings. Xcconfig files are a way to manage this complexity. Let’s dive into understanding how to use Xcconfig files in Xcode projects. What is an Xcconfig file? An Xcconfig, or Xcode configuration file, is a plain text file used by Xcode to externalise configuration settings for build systems. These files use the .xcconfig file extension and can contain build settings, variable declarations, comments, etc. ...

May 15, 2023 · Mike Gopsill ·  Tools

Target Dependencies vs Link Binary with Libraries

When developing iOS applications with Xcode, it’s essential to understand the difference between “Target Dependencies” and “Link Binary with Libraries.” These two options found in the Build Phases settings of a target play vital roles in defining how your app interacts with external code. In this article, we’ll discuss what these options do and how they are different. Understanding Targets Before we delve into the differences, let’s first understand what a ‘Target’ is in Xcode. A target specifies a set of build configurations which define how to build a product in Xcode. It could be an app, a framework, or a unit test bundle. Each target contains information about how to build the product, including build settings, build phases, and the product’s dependencies. ...

May 12, 2023 · Mike Gopsill ·  Tools

Codespaces with a Swift Package

In this post we will learn how to build a Swift Package using a GitHub Codespace. I did this recently as an experiment. It was easier than expected. The codespace was quick to build and test on too. It could be a useful tool when you have a poor local environment, e.g. an aging Intel MacBook. That said, there’s limitations too. What are Codespaces Github codespaces are development environments in the cloud. They allow you to develop from your browser. Opening a codespace displays a VS Code IDE. You can install libraries, dependencies and tools. You can run any code you write in the terminal. ...

February 16, 2023 · Mike Gopsill ·  Tools