// permanent fix for 3 instead of > // divi mobile menu collapsing effect

Build Select Script Overview

This page provides documentation for the Build Select Script. This script (updated May 2023) has new features and automates more steps to simplify the process. Please read this update summary.

The options provided by the Build Select Script are:

  1. Download and Build Loop
  2. Download and Build Related Apps
  3. Run Maintenance Utilities
  4. Run Customization Select
  5. Exit the Script

If you previously used this script, but not recently, you will notice:

  • The script is now hosted at a new GitHub username (loopandlearn) in a new repo (lnl-scripts)
    • The old address is mirrored (so still works for now) but please switch to the new address
  • It is easier to sign and build your app
  • Additional apps related to Loop can be built
  • Maintenance Utilities clear disk space on Mac, including removing old downloads
  • Customization Select provides options to add or remove Loop customization
  • Menu repeats so you can perform multiple actions

Before using the script to build an app, review the requirements for that app.

  • If you are building or updating Loop, have you checked Version Updates to make sure that your versions of iOS, Xcode, and macOS are compatible?
  • If you need to clear disk space prior to updating your Mac, use the Maintenance Utility options
  • Do you need to sign an updated Apple Developer agreement or update your credit card information?
  • Do you have a charging cable to connect your Mac to your iPhone?
  • For more documentation on steps you need to take before updating Loop, follow this link to LoopDocs: Updating

If you don’t have a Mac or your Mac is too old to update to the required versions for your phone iOS, consider LoopDocs: Browser Build, which can be done from an older mac, a PC or a tablet.

A script is a series of commands that are meant to be issued to your Mac in the terminal window (on a Mac or a virtual Mac on a PC). The script issues the commands in order and checks the status as it goes along. It makes your app download and build easier. For more in-depth documentation, including step-by-step graphics, please see: LoopDocs: Mac-Xcode Build.

The script provides a menu for you to select your desired option, and then guides you through the steps for each option. When that option has been completed, you are returned to the top-level menu to select another option or exit the script.

It is a good idea to review this entire page before starting the script. Please read the messages as you proceed.

Run the Script

Carefully read the information in the terminal 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 the entire line starting with /bin/bash and then Paste the line into the Terminal and enter

Click on the line below to copy it. You’ll see Copied to Clipboard briefly.

Step 3: Choose from one of the options

  1. Download and Build Loop
  2. Download and Build Related Apps
  3. Run Maintenance Utilities
  4. Run Customization Select
  5. Exit the Script

Many of these options offer several choices. If you change your mind after selecting an option, you can choose “Return to Menu” to get back to the top-level menu shown above.

If you choose an option that involves downloading and building an app

  • You will be required to acknowledge a warning
  • There are automated checks that Xcode is installed
  • The script reports the version of Xcode you have installed and what iOS it can support
  • You should choose `Ensure a Year` when offered, that means the app on your device will last for one year from the build date

Selection 1: Download and Build Loop

If you type 1 for Download and 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 are confused about any of the steps – please STOP and ask for help.

If you don’t know which version of Loop you want, review Loop with Patches. Unless you need the Libre interface support provided with Loop with Patches, you are best off selecting Loop and then choose your customizations after downloading.

Loop Version Options

  1. Loop
  2. Loop with Patches
  3. Return to Menu

Type either 1 or 2 depending upon which version of Loop you’d like to build, and then click return. Cancel returns to the top-level menu.

  • If a release of Loop just happened, it might take a day for Loop with Patches to be updated.
  • The status can be found on the Version Updates page

The script will automatically

  • Download the latest code for the version that you selected
  • Make sure your Xcode path is set correctly
  • Check the status for automatic signing and walk you through the steps to configure it if needed
  • Ask if you want to ensure a year (you should say yes)
  • Start Xcode pointing to the newly downloaded code already signed and ready to build Loop using LoopWorkspace

Xcode will automatically download some “packages” from the internet so you can build Loop. If you hit the Build button too soon, there’s a nice new warning message.

  • Build operations are disabled: Package loading in progress.
  • Click on OK and wait until you see the word indexing in upper right, then try again

Optional:

The script returns to the main menu so you can select another option. You can choose to Run Customization Select or to build another related app, like LoopCaregiver or Loop Follow, without exiting the Build Select Script.

  • Best practice is to build to a Simulator (not your phone) to confirm all was correct with the download
  • If you have favorite customizations, add them and build to the simulator again (see Run Customization Select)
  • Finally, install the app on your “real” phone
  • If you plan to build to a simulator or create an archive file as a remote backup (LoopDocs: TestFlight from Xcode), then skip plugging in the phone

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

    Please always use screen shots from your Mac when asking for help. Photos taken from your phone are inadequate.

    • Command-Shift-3 and click for the full screen
    • Command-Shift-4 then space bar and click for the full Xcode window

    Selection 2: Download and Build Related Apps

    If you type 2 for Download and Build Related Apps and return, you will be given the choice of several apps related to using Loop. The build process follows the same pattern as the build process for Loop and includes automatic signing of the app. If you make a selection and then decide not to build that app, you can select “Return to Menu”; that takes you all the way up to the top-level menu.

    Loop Follow is an app that combines display information and alerts into a single easy-to-use interface. Loop Follow can get its data from Dexcom Share or Nightscout. There is more information at LnL: Loop Follow.

    If you select Build Loop Follow, the script will download the latest version of Loop Follow code and install it. You are offered a choice to build one of two branches, Main or dev. Most people should choose the Main branch.

    LoopCaregiver is an app that enables a caregiver to monitor a Looper and provide remote commands to a Looper’s phone over wireless or cellular networks. There is documentation at LoopDocs: LoopCaregiver.

    If you select Build LoopCaregiver, the script will download the latest version of LoopCaregiver code and install it. You will be warned that this app is under development and be asked to review some links prior to using it.

    Build xDrip4iOS (CGM App)

    xDrip4iOS is an app that can read a variety of CGM devices, including some Libre sensors. If you build xDrip4iOS with the same developer ID as Loop with Patches, you can use xDrip4iOS as the source of glucose for Loop. If you must use a version of xDrip4iOS not built with the same developer ID, then you will have to use Nightscout as a CGM with Loop and maintain consistent connection with the network.

    • Do not allow xDrip4iOS to write to Health if you are using Nightscout as a CGM
    • Do not allow xDrip4iOS to write to Health if you are using a Libre sensor that reports at 1-minute intervals
    • Make sure to limit Libre sensors to report to Loop only once every 5 minutes (Loop reads from Health)

    Glucose Direct is an app that can read a variety of CGM devices, including some Libre sensors. If you build Glucose Direct with the same developer ID as Loop with Patches, you can use Glucose Direct as the source of glucose for Loop. If you must use a version of Glucose Direct not built with the same developer ID, then you will have to use Nightscout as a CGM with Loop and maintain consistent connection with the network.

    • Do not allow Glucose Direct to write to Health if you are using Nightscout as a CGM
    • Do not allow Glucose Direct to write to Health if you are using a Libre sensor that reports at 1-minute intervals
    • Make sure to limit Libre sensors to report to Loop only once every 5 minutes (Loop reads from Health)

    Selection 3: Run Maintenance Utilities

    If you type 3 for Run Maintenance Utilities and return, then the script will offer some choices to help clear off disk space.

    1. Delete Old Downloads
    2. Clean Derived Data
    3. Xcode Cleanup (The Big One)
    4. Return to Menu

    Each download can be up to 1 GB in size and you do not need to keep old versions around.

    Xcode derives a lot of data when it does a build. By deleting derived data, you clean up a lot of space.

    If you need more space in order to update to a newer version of Xcode, sometimes the best approach is to delete Xcode (and empty the trash) and then run `Xcode Cleanup`. Reboot your computer and then install the new version of Xcode.

    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 Need Even More Space on Xcode Cleanup page.

    If you are doing updates or customizations to an existing download and Xcode is giving errors, you might want to quit Xcode, use the `Clean Derived Data` utility option and try again.

    Selection 4: Run Customization Select

    If you type 4 for Run Customization Select and return, the Loop Customization Select Script will execute. Follow the link for information about this script.

    When you have completed adding or removing any customizations desired, you can return to the Build Select Script menu.

    
    

    Special Case: Access All Scripts

    There are several scripts available for building apps not included in the Build Select Script. This includes BuildFreeAPS.sh for FreeAPS, Build_iAPS.sh for iAPS and BuildLoopDev.sh for development branch(es) for Loop.

    To find instructions for building those apps using a script, follow the link to the README page for the lnl-scripts repository. Each app not included in the Build Select Script menu has a copy/paste section for easy use.

    Skip to content