What you end up with
Nut AI running on your Android. It is free, and it stays free. It opens with Sign in with publik; no trial, no subscription.
- Time
- About 45 minutes
- Steps
- 22
- Cost
- Free
Before you start
These are one-time installs. If you have used Terminal before, you may have them already — the first step checks.
Install Git
Apple opens a small installer.
Type this into Terminal, then press Return.
xcode-select --installYou know this worked when: Git responds with a version number
Install Node LTS
Choose the macOS Installer (.pkg).
Open downloadYou know this worked when: Node responds with a version number
Install Nut AI
Open Terminal
Keep it open beside this page.
You know this worked when: Terminal is open
Check Git and Node
Needs Git and Node 22.16+, not 23. Rebuild an old Nut AI: its photo scans fail but can be charged.
Type this into Terminal, then press Return.
git --version node --versionYou know this worked when: Git and Node respond with version numbers
Copy Nut AI to this Mac
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~ if [ ! -d nut-ai/.git ]; then git clone https://github.com/Blueturboguy07/nut-ai.git fiYou know this worked when: A nut-ai folder appears
Open the nut-ai folder
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~ cd nut-aiYou know this worked when: Your terminal prompt is inside the nut-ai folder
Use the reviewed version
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai ( if ! git config --get remote.origin.url 2>/dev/null | sed -E 's#^git@github\.com:#https://github.com/#; s#\.git$##' | grep -qxF "https://github.com/Blueturboguy07/nut-ai"; then echo "~/nut-ai already exists and is not a copy of this app's source. Move or rename that folder, then press Try again." exit 1 fi if ! git cat-file -e 6a6b9e741e307f4176a7db7a778ddb2fb58c4114 2>/dev/null && ! git fetch --no-tags https://github.com/Blueturboguy07/nut-ai.git 6a6b9e741e307f4176a7db7a778ddb2fb58c4114; then echo "Could not download the reviewed version. Check your internet connection, then press Try again." exit 1 fi if git status --porcelain 2>/dev/null | grep -q .; then git -c user.name=iris-guide -c user.email=iris-guide@localhost stash push --include-untracked -m "Saved by the install guide" || exit 1 echo "Your changes in ~/nut-ai are saved with git stash. To see them: git stash list" fi git checkout 6a6b9e741e307f4176a7db7a778ddb2fb58c4114 )You know this worked when: Git reports the reviewed commit
Install dependencies
Vulnerability warnings at the end are expected here — don't run npm audit fix.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai node scripts/check-node-version.cjs && npm install --no-saveYou know this worked when: The command finishes without an error
Build the nutrition database
It downloads the USDA tables itself first (about 10 MB). Re-running it is always safe.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai npm run data:buildYou know this worked when: It ends with 'Built …/nutrition.db' and foods: 7928
Install Android Studio
Accept the standard setup so it installs the SDK.
Open downloadYou know this worked when: Android Studio opens to its welcome screen
Install Java 17
The Android build needs a JDK 17 to 21, not only a Java runtime. Installs Temurin 17 if none.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~ rm -f ~/.nut-ai-java-home if [ -n "$JAVA_HOME" ] && [ -x "$JAVA_HOME/bin/javac" ] && "$JAVA_HOME/bin/java" -version 2>&1 </dev/null | grep -Eq 'version "(1[7-9]|2[01])[."]'; then echo "$JAVA_HOME" > ~/.nut-ai-java-home; fi [ -s ~/.nut-ai-java-home ] || find -L /Library/Java/JavaVirtualMachines ~/Library/Java/JavaVirtualMachines ~/.nut-ai-jdk -maxdepth 5 -path '*/Contents/Home/bin/java' 2>/dev/null | while IFS= read -r j; do [ -x "${j%/java}/javac" ] && "$j" -version 2>&1 </dev/null | grep -Eq 'version "17[."]' && echo "${j%/bin/java}" > ~/.nut-ai-java-home && break; done [ -s ~/.nut-ai-java-home ] || find -L /Library/Java/JavaVirtualMachines ~/Library/Java/JavaVirtualMachines ~/.nut-ai-jdk -maxdepth 5 -path '*/Contents/Home/bin/java' 2>/dev/null | while IFS= read -r j; do [ -x "${j%/java}/javac" ] && "$j" -version 2>&1 </dev/null | grep -Eq 'version "(1[89]|2[01])[."]' && echo "${j%/bin/java}" > ~/.nut-ai-java-home && break; done if [ ! -s ~/.nut-ai-java-home ]; then uname -m | grep -q arm64 && NUT_AI_JDK_ARCH=aarch64 NUT_AI_JDK_SHA=78b08c7f5a0598242d5719c022e19479cb4a3aa45c37c19726a757a469ed1c15 || NUT_AI_JDK_ARCH=x64 NUT_AI_JDK_SHA=868f5c672b3389fdbe48e44f94ae170f01668b1401360944fc7159d7cc9772cc curl -fL --retry 3 -o ~/.nut-ai-jdk.tar.gz "https://api.adoptium.net/v3/binary/version/jdk-17.0.21%2B9/mac/$NUT_AI_JDK_ARCH/jdk/hotspot/normal/eclipse" echo "$NUT_AI_JDK_SHA $HOME/.nut-ai-jdk.tar.gz" | shasum -a 256 -c - && mkdir -p ~/.nut-ai-jdk && tar -xzf ~/.nut-ai-jdk.tar.gz -C ~/.nut-ai-jdk && "$HOME/.nut-ai-jdk/jdk-17.0.21+9/Contents/Home/bin/java" -version 2>&1 </dev/null | grep -Eq 'version "17[."]' && echo "$HOME/.nut-ai-jdk/jdk-17.0.21+9/Contents/Home" > ~/.nut-ai-java-home rm -f ~/.nut-ai-jdk.tar.gz fi read -r JAVA_HOME < ~/.nut-ai-java-home && export JAVA_HOME "$JAVA_HOME/bin/java" -version [ -x "$JAVA_HOME/bin/javac" ] && "$JAVA_HOME/bin/java" -version 2>&1 | grep -Eq 'version "(1[7-9]|2[01])[."]' || { echo 'No JDK 17 to 21 is ready. Install the Temurin 17 JDK from adoptium.net, then run this step again.'; false; }You know this worked when: java -version prints a JDK version from 17 to 21
Turn on USB debugging
Settings → About phone → tap Build number 7×. Then Developer options → USB debugging.
You know this worked when: Developer options shows USB debugging on
Plug in your phone
Tap Allow on the phone. If nothing appears, try another cable — that is the usual cause.
You know this worked when: adb devices lists your phone
Generate the Android project
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile npx expo prebuild --platform androidYou know this worked when: An android folder appears inside apps/mobile
Download the Android build tools
The first run downloads Gradle and the Android NDK. Later runs take about a minute.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew helpYou know this worked when: Gradle prints BUILD SUCCESSFUL
Build the C++ code, part 1 of 3
Compiles C++ code for your phone's processor only. Keep the phone plugged in until the end.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew :react-native-worklets:externalNativeBuildRelease :react-native-nitro-modules:externalNativeBuildRelease :react-native-screens:externalNativeBuildRelease :expo-modules-core:externalNativeBuildReleaseYou know this worked when: Gradle prints BUILD SUCCESSFUL
Build the C++ code, part 2 of 3
Compiles the C++ code of the animation libraries.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew externalNativeBuildRelease -x :app:externalNativeBuildReleaseYou know this worked when: Gradle prints BUILD SUCCESSFUL
Build the C++ code, part 3 of 3
Compiles the app's own C++ code. This is the longest build step.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew :app:externalNativeBuildReleaseYou know this worked when: Gradle prints BUILD SUCCESSFUL
Build the Kotlin and Java code
Compiles the libraries' Kotlin and Java code.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew assembleRelease -x :app:assembleReleaseYou know this worked when: Gradle prints BUILD SUCCESSFUL
Check and convert the libraries
Checks the libraries for release errors and converts them to Android code.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile/android { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures ./gradlew lintVitalAnalyzeRelease :app:mergeExtDexRelease -x :app:lintVitalAnalyzeReleaseYou know this worked when: Gradle prints BUILD SUCCESSFUL
Build and install
Builds the app, installs it on your phone and opens it.
Type this into Terminal, then press Return. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~/nut-ai/apps/mobile { read -r JAVA_HOME < ~/.nut-ai-java-home && [ -x "$JAVA_HOME/bin/javac" ]; } || { echo 'Run the Install Java 17 step first. It picks the Java this build needs.'; JAVA_HOME=/run-the-Install-Java-17-step-first; } export JAVA_HOME export GRADLE_OPTS="\"-Dorg.gradle.java.home=$JAVA_HOME\"" [ -n "$ANDROID_HOME$ANDROID_SDK_ROOT" ] || [ ! -d "$HOME/Library/Android/sdk" ] || export ANDROID_HOME="$HOME/Library/Android/sdk" "${ANDROID_HOME:-$ANDROID_SDK_ROOT}/platform-tools/adb" shell getprop ro.product.cpu.abilist 2>/dev/null | tr ', \r' '\n\n\n' | grep -m 1 -x -E 'armeabi-v7a|arm64-v8a|x86|x86_64' > ~/.nut-ai-abi read -r ORG_GRADLE_PROJECT_reactNativeArchitectures < ~/.nut-ai-abi || ORG_GRADLE_PROJECT_reactNativeArchitectures=arm64-v8a export ORG_GRADLE_PROJECT_reactNativeArchitectures npx expo run:android --variant release --no-bundlerYou know this worked when: The build ends with an install onto your phone
Open Nut AI on your phone
Scans run on publik API; link the phone when asked. Your own AI key also works (Profile).
You know this worked when: Nut AI opens on your phone
If something goes wrong
Nothing here can damage your computer, and every step can be run again safely. If a command fails, the usual cause is the step before it not having finished.
Still stuck? Tell us what happened and we will fix the guide. Include the step number and we can usually reproduce it.