Skip to content

Commit a9fb0ab

Browse files
Add feature installer script for L&L-compatible installs
Provides an alternative install method where users run a script on a standard Loop clone after applying any L&L customizations. The script uses anchor-based text insertion and 3-way merges to adapt to whatever patches are already present, making all L&L customizations compatible. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3657138 commit a9fb0ab

3 files changed

Lines changed: 1408 additions & 0 deletions

File tree

INSTALL.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Install FoodFinder + LoopInsights + AutoPresets
2+
3+
Add AI-powered food analysis, therapy settings insights, and automatic preset management to your Loop app — compatible with Loop & Learn customizations.
4+
5+
## Prerequisites
6+
7+
- **Xcode 15+** (15.4 recommended)
8+
- **iOS 17+** on your target device
9+
- **macOS** with git and python3 (both ship with Xcode Command Line Tools)
10+
- **API key** for AI features (OpenAI, Anthropic, or Google — configured in-app after install)
11+
12+
## Step 1: Clone LoopWorkspace
13+
14+
Follow the standard Loop build instructions:
15+
https://loopkit.github.io/loopdocs/build/step4/
16+
17+
```bash
18+
git clone --branch=main --recurse-submodules https://github.com/LoopKit/LoopWorkspace
19+
cd LoopWorkspace
20+
```
21+
22+
## Step 2: Apply Loop & Learn Customizations (Optional)
23+
24+
If you want L&L customizations (Profiles, Basal Lock, Negative Insulin, etc.), apply them **before** running the feature installer:
25+
26+
https://www.loopandlearn.org/custom-code/
27+
28+
All L&L patches are compatible with our features. The installer automatically adapts to whatever patches are present.
29+
30+
## Step 3: Install Features
31+
32+
From the LoopWorkspace root directory:
33+
34+
```bash
35+
/bin/bash Scripts/install_features.sh
36+
```
37+
38+
Or, if you haven't cloned this repository yet:
39+
40+
```bash
41+
curl -fsSL https://raw.githubusercontent.com/TaylorJPatterson/LoopWorkspace/feat/installer/Scripts/install_features.sh -o /tmp/install_features.sh
42+
curl -fsSL https://raw.githubusercontent.com/TaylorJPatterson/LoopWorkspace/feat/installer/Scripts/update_pbxproj.py -o Scripts/update_pbxproj.py
43+
/bin/bash /tmp/install_features.sh
44+
```
45+
46+
The script will:
47+
1. Validate your environment
48+
2. Back up your current state (git stash)
49+
3. Fetch the feature source code
50+
4. Install 77 new files and patch 11 existing files
51+
5. Update the Xcode project file
52+
6. Validate everything
53+
54+
## Step 4: Build in Xcode
55+
56+
1. Open `LoopWorkspace.xcworkspace` in Xcode
57+
2. Select your signing team
58+
3. Build and run (Cmd+R)
59+
60+
## Step 5: Enable Features in Settings
61+
62+
All features are **off by default**. Enable them in the Loop app:
63+
64+
- **FoodFinder**: Settings → FoodFinder → Toggle on. Enter your AI API key.
65+
- **LoopInsights**: Settings → LoopInsights → Toggle on. Same API key is shared.
66+
- **AutoPresets**: Settings → AutoPresets → Configure motion detection and preset rules.
67+
68+
## Updating
69+
70+
To update to the latest feature version:
71+
72+
1. Run the rollback: `./Scripts/install_features.sh --rollback`
73+
2. Re-run the installer: `./Scripts/install_features.sh`
74+
75+
## Uninstalling
76+
77+
```bash
78+
./Scripts/install_features.sh --rollback
79+
```
80+
81+
This removes all feature files and restores your Loop to its pre-install state (including any L&L patches you had applied).
82+
83+
## L&L Compatibility
84+
85+
| L&L Customization | Compatible | Notes |
86+
|---|---|---|
87+
| Profiles | Yes | Our features insert below Profiles in Settings |
88+
| Basal Lock | Yes | Different code regions than our features |
89+
| Negative Insulin | Yes | Different code regions than our features |
90+
| Future Carbs 4h | Yes | Both modify CarbEntryView.swift but in different regions; 3-way merge handles it |
91+
| Override Insulin Needs Picker | Yes | No overlapping files |
92+
| All other L&L patches | Yes | Our installer only modifies Loop submodule files |
93+
94+
## Troubleshooting
95+
96+
**"Anchor not found" error**: Your Loop version may be too old or too new. The installer targets Loop dev branch (v3.10.x). Make sure you cloned the latest LoopWorkspace.
97+
98+
**Merge conflicts during patching**: If the installer reports conflicts, check the affected file for `<<<<<<<` conflict markers and resolve them manually.
99+
100+
**Xcode build errors after install**: Try a clean build (Cmd+Shift+K, then Cmd+R). If issues persist, run `--rollback` and re-install.
101+
102+
**plutil validation failure**: The Xcode project file update failed. The installer automatically restores the backup. Try again — if it persists, file an issue.

0 commit comments

Comments
 (0)