There are plenty of apps out there that can be beneficial to an organization, but don’t really make sense to live on an app store. This might be because the app uses private APIs, breaks acceptable design patterns, needs to be customized for every use case, is just proof of concept code, etc, etc, etc. Anyone with an Apple Developer certificate can compile an app to test it on their local machine. We can go into more detail later for people that want to then distribute/re-distribute those apps…
To get started, first we’ll clone the project to our local machine. To do so, in Github or Gitlab or wherever it lives, from a machine with Xcode, let’s just click on the Clone button, and select Xcode.
The deeplink opens Xcode (or asks to do so) and then you have an option for which branch you want to clone. There may be multiple branches if there are different developers or epics or features being worked on, but for the purposes of this article we’ll just use “main”. Click Clone, select a location, and the project will download to the computer.
Once downloaded, open the .xcodeproj folder in the root of the directory it was downloaded to.
At this point, if the project uses swift packages, we might need to wait for those to download fully to compile. Under Package Dependencies, check to see if those have a status that they’re downloading. In general if it’s not greyed out a little and all the files show, you’re fine. It usually takes less time than it’ll take to do the next steps, so don’t worry about that unless you get an error later.
Next, let’s choose our developer certificate. We need to do this for each “target” we’ll be compiling for. Click on the name of the project in the file tree and then Signing & Capabilities in the tab along the top of the screen (pardon me if I’m not using the correct terms to identify these – but before and after screenshots are shown below for each).
Once each target has been appropriately provided with the correct signing certificate, click on the build button (looks like a play button) towards the top of the screen. The app will compile, provided there are no errors. Note that in the below screen, we see warnings, but they’re yellow, not red, so all good. Head back to the Finder and the app should be open (in this case it’s a menu bar item so won’t appear in the Dock). To then see the compiled app, click on the Product menu and select Show Build Folder in Finder.
Nested in that Build folder is the product with which you seek. It should run on machines with the appropriate certificates. For more on how to make it more widely distributable, see https://developer.apple.com/documentation/xcode/preparing-your-app-for-distribution.