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 PowerShell before, you may have them already — the first step checks.
Install Git
Run the installer, then reopen PowerShell.
Open installerYou know this worked when: Git responds with a version number
Install Node LTS
Run the LTS installer, then reopen PowerShell.
Open downloadYou know this worked when: Node responds with a version number
Install Nut AI
Open PowerShell
Keep it open beside this page.
You know this worked when: PowerShell 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 PowerShell (not Command Prompt), then press Enter.
git --version node --versionYou know this worked when: Git and Node respond with version numbers
Copy Nut AI to this PC
Type this into PowerShell (not Command Prompt), then press Enter. 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 PowerShell (not Command Prompt), then press Enter. 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 PowerShell (not Command Prompt), then press Enter. 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 $origin = git config --get remote.origin.url 2>$null if ($origin) { $origin = $origin -replace '^git@github\.com:', 'https://github.com/' -replace '\.git$', '' } if ($origin -ne "https://github.com/Blueturboguy07/nut-ai") { Write-Output "~/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 } git cat-file -e 6a6b9e741e307f4176a7db7a778ddb2fb58c4114 2>$null if ($LASTEXITCODE -ne 0) { git fetch --no-tags https://github.com/Blueturboguy07/nut-ai.git 6a6b9e741e307f4176a7db7a778ddb2fb58c4114 } if ($LASTEXITCODE -ne 0) { Write-Output "Could not download the reviewed version. Check your internet connection, then press Try again." exit 1 } $dirty = git status --porcelain 2>$null if ($dirty) { git -c user.name=iris-guide -c user.email=iris-guide@localhost stash push --include-untracked -m "Saved by the install guide" if ($LASTEXITCODE -ne 0) { exit 1 } Write-Output "Your changes in ~/nut-ai are saved with git stash. To see them: git stash list" } git checkout 6a6b9e741e307f4176a7db7a778ddb2fb58c4114You 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 PowerShell (not Command Prompt), then press Enter. 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 if ($LASTEXITCODE -eq 0) { npm.cmd install --no-save }You 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 PowerShell (not Command Prompt), then press Enter. 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.cmd 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 PowerShell (not Command Prompt), then press Enter. The first line moves you into the folder this step runs in, so it works in a window you have just opened.
cd ~ function Get-JavaMajor ($jdk) { if (-not $jdk -or -not (Test-Path -LiteralPath ($jdk + '\bin\java.exe')) -or -not (Test-Path -LiteralPath ($jdk + '\bin\javac.exe'))) { return 0 } $keep = $env:Path $env:Path = $jdk + '\bin;' + $env:Path $v = cmd /c "java -version 2>&1" | Out-String $env:Path = $keep if ($v -match 'version "1\.(\d+)') { return [int]$Matches[1] } if ($v -match 'version "(\d+)') { return [int]$Matches[1] } return 0 } function Find-Jdk ($dirs, $low, $high) { foreach ($d in $dirs) { $m = Get-JavaMajor $d; if ($m -ge $low -and $m -le $high) { return $d.TrimEnd('\') } } } $roots = 'Eclipse Adoptium', 'Java', 'Microsoft', 'Zulu', 'Amazon Corretto', 'Android\Android Studio' function Get-Jdks { $roots | ForEach-Object { Get-ChildItem (Join-Path $env:ProgramFiles $_) -Directory -ErrorAction SilentlyContinue } | ForEach-Object { $_.FullName } } $homes = [Environment]::GetEnvironmentVariable('JAVA_HOME', 'User'), [Environment]::GetEnvironmentVariable('JAVA_HOME', 'Machine'), $env:JAVA_HOME $jdk = Find-Jdk $homes 17 21 if (-not $jdk) { $jdk = Find-Jdk (Get-Jdks) 17 17 } if (-not $jdk) { $jdk = Find-Jdk (Get-Jdks) 18 21 } if (-not $jdk) { winget install --id EclipseAdoptium.Temurin.17.JDK -e --source winget --accept-source-agreements --accept-package-agreements $jdk = Find-Jdk (Get-Jdks) 17 17 } if (-not $jdk) { Write-Output 'No JDK 17 is installed yet. Install the Temurin 17 JDK from adoptium.net, then run this step again.'; exit 1 } Set-Content -Path ($HOME + '\.nut-ai-java-home') -Value $jdk -Encoding UTF8 $env:JAVA_HOME = $jdk $env:Path = $jdk + '\bin;' + $env:Path Write-Output ('The Android build uses the Java in ' + $jdk) cmd /c "java -version 2>&1"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 PowerShell (not Command Prompt), then press Enter. 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.cmd 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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat 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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat :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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat 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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat :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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat 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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' .\gradlew.bat 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 PowerShell (not Command Prompt), then press Enter. 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 $jh = Get-Content -Path ($HOME + '\.nut-ai-java-home') -TotalCount 1 -Encoding UTF8 -ErrorAction SilentlyContinue if (-not $jh -or -not (Test-Path -LiteralPath ($jh + '\bin\javac.exe'))) { Write-Output 'Run the Install Java 17 step first. It picks the Java this build needs.'; exit 1 } $jh = $jh.TrimEnd('\') $env:JAVA_HOME = $jh $env:Path = $jh + '\bin;' + $env:Path $sdk = $env:ANDROID_HOME if (-not $sdk) { $sdk = $env:ANDROID_SDK_ROOT } $sdkDefault = $HOME + '\AppData\Local\Android\Sdk' if (-not $sdk -and (Test-Path $sdkDefault)) { $sdk = $sdkDefault; $env:ANDROID_HOME = $sdk } $adb = New-Object System.Diagnostics.ProcessStartInfo ($sdk + '\platform-tools\adb.exe'), 'start-server' $adb.UseShellExecute = $true $adb.WindowStyle = 'Hidden' if ($sdk -and (Test-Path $adb.FileName)) { [System.Diagnostics.Process]::Start($adb).WaitForExit() } $abis = '' if ($sdk -and (Test-Path $adb.FileName)) { $abis = & $adb.FileName shell getprop ro.product.cpu.abilist 2>$null } $abi = @("$abis" -split '[,\s]+' | Where-Object { 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' -contains $_ })[0] if (-not $abi) { $abi = 'arm64-v8a' } $env:ORG_GRADLE_PROJECT_reactNativeArchitectures = $abi $env:GRADLE_OPTS = '-Dorg.gradle.daemon=false "-Dorg.gradle.java.home=' + $jh + '"' npx.cmd 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.