// Collapsable Mobile Menus

Introduction to Build-Select Script

This page will help you use menu-driven scripts to install the latest released version of Loop, FreeAPS (Loop fork), or Loop Follow. It also has utility options to assist with cleanup, Xcode updates, and provisioning profiles.  If you follow these instructions carefully, your Loop app should last one full year, however, we recommend that you build 3 to 4 times per year in order to keep your app up to date and to become more comfortable with the build process.

  • Before you start, take some time to make sure that you’re ready for your build:
    • Do you have a charging cable to connect your mac to your iPhone?
    • Have you checked Version Updates to make sure that your versions of iOS, Xcode and macOS are compatible?
    • Do you need to sign an updated Apple Developer agreement or update your credit card information?
  • If your Mac is too old to update to Monterey (which is required for iOS 15.4 and higher), some community members have successfully updated their macOS using this video.
  • If your Xcode is too old for your phone’s iOS, read the Xcode Too Old section.
  • If you’ve used this page before and don’t need the instructions, you can skip ahead to Script Instructions.
  • If you are trying to build the Loop-dev, or FreeAPS-dev, version with DASH support, there is a page on the LoopDocs Site
    • Make sure you followed the “Before you start” steps above
    • Please, read the links with warnings and caveats about building a development branch in the link below before building
    • Go to Building Loop-dev Page in LoopDocs

What is a script?

A script is a series of commands that are meant to be issued to your Mac OS in the terminal window (on a mac or a virtual mac on a PC). The script issues the commands in order and checks status as it goes along. It just makes your Loop build easier. For more in-depth knowledge, read the pages on building (Loopdocs: Building) or updating (Loopdocs: Updating).  (Note, the link to Loopdocs goes to the updating page.)

What will the script do?

First, the script will warn you that this is a DIY system.  You must acknowledge to continue.

Please read the options carefully:

  1. Build Loop
  2. Build Loop Follow
  3. Utility Scripts
  4. Cancel

Selection 1: Build Loop

If you type 1 for Build Loop and return, the script will ask which version of Loop you want to install. Once you make a selection, it will check that your system has the required elements, download the latest version of code to a new download folder, and help you install it.

If you don’t know which version you want after reading the information at Compare Versions or are confused about any of the steps – please STOP and ask for help.

Released Loop version is Loop v2.2.9.

  • If you built Loop v2.2.5 during the short window from Aug 22 through Sep 6, 2021, please rebuild ASAP.

Loop Version Options

  1. Loop (supports temporary basals and automatic bolus as dosing strategy)
  2. FreeAPS (uses slightly different approach for dosing strategy)

Type either 1 or 2 depending upon which version of Loop you’d like to build, and then click return.

The script will automatically

  • Download the latest code for the version that you selected
  • Start Xcode pointing to the newly downloaded code
  • Open a page showing you how to do a Workspace build (it’s easy)
  • Optional:  If you have favorite customizations, enter them before hitting the build button

If you get an error while building Loop, head on over to the LoopDocs Build Error page.  If you need to Ask for Build Help, be sure to provide all of the details that volunteer troubleshooters will need.

Selection 2: Build Loop Follow

If you type 2 for Build Loop Follow and return, then the script will download the latest version of Loop Follow code and install it. If you are not familiar with Loop Follow, there is information at the Loop Follow ReadMe. You can also join and ask for help in the Custom Type One Facebook group.

Selection 3: Utilities

If you type 3 for Utilities and return, then the script will offer some choices.  PLEASE read carefully.

  1. Clean Derived Data
  2. Xcode Cleanup (The Big One)
  3. Clean Profiles

Option 3 is recommended for each time that you build.   It resets the provisioning profiles so you get a full year from the date of the build.  However, we recommend that you build 3 to 4 times per year in order to keep your app up to date and to become more comfortable with the build process.

If you’ve run these utility scripts in the hope of cleaning up unused and unneeded files and you still need more space, check out Xcode Cleanup.

If you are doing updates or customizations to an existing download, you might want to use the Clean Derived Data utility option.

Run the Script

Carefully read each of the Steps below before making any choices.

Step 1: Open Terminal.

Tip: press command-space to open spotlight search. Start typing “term” (without the quotes) and you will see the Terminal application icon in the box. Hit enter to open.

Step 2: Copy/Paste the line below into the Terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/loopnlearn/LoopBuildScripts/main/BuildLoop.sh)"

Step 3: Hit Return, then select Utility Scripts and choose Option 3 so that your Loop app will last a full year.

When done, rerun the script and select a new option by simply hitting up arrow on the keyboard while in the terminal

Step 4:  Hit Return to run the script a second time and select Option 1:  Build Loop.  When your Loop code is finished downloading, two windows will open: 

    • Xcode
    • Diagram that depicts the steps that you’ll need to take within Xcode

If you get an error message while downloading your Loop code, head on over to Loopdocs.

Step 5: Plug your charging cable into your Mac and connect it to your iPhone. 

Xcode Too Old

What if your Xcode is too old for your phone iOS? The traditional wisdom is to follow the steps to update mac OS and Xcode version, but sometimes you cannot do that and you need to build Loop anyway.

If this is you, once you’ve downloaded the code, you should follow this video provided by Jon Fawcett that enables you to build Loop anyway as long as your iOS version is 14.x.  This method does not work with iOS 15.  (The link to the video is repeated on the workspace build instructions that automatically open when you run the script.)

  • If you use this method with Xcode 12.4 or earlier
    • you cannot build to an iOS 15 phone
    • you cannot build to an iOS 14.x phone and later update to iOS 15 because your Loop app will stop working 

And for any who are reading this and wondering:

  • If you build your Loop app with Xcode 12.5 or later – the Loop app will continue working on the phone when you upgrade to iOS 15
  • Just remember – it is good policy to always be able to rebuild Loop
Skip to content