-
Notifications
You must be signed in to change notification settings - Fork 336
Bootstrap Mentra Live firmware during ASG dev setup #3737
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |||||||||
| # and installs your version as the default launcher. | ||||||||||
| # | ||||||||||
| # How it works: | ||||||||||
| # - Updates stock ASG/BES/MTK from one latest-staging manifest snapshot | ||||||||||
| # - Stock asg_client is a system app signed with Mentra's key | ||||||||||
| # - Your build uses package name com.mentra.asg_client.thirdparty | ||||||||||
| # - Stock app is disabled (not deleted) so your app becomes the launcher | ||||||||||
|
|
@@ -16,17 +17,25 @@ | |||||||||
| # 2. Run: ./scripts/dev-setup.sh | ||||||||||
| # | ||||||||||
|
|
||||||||||
| set -e | ||||||||||
| set -euo pipefail | ||||||||||
|
|
||||||||||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||||||||||
| ASG_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" | ||||||||||
| REPO_DIR="$(cd "$ASG_DIR/.." && pwd)" | ||||||||||
| source "$REPO_DIR/scripts/lib/glasses-device.sh" | ||||||||||
|
|
||||||||||
| STOCK_PKG="com.mentra.asg_client" | ||||||||||
| DEV_PKG="com.mentra.asg_client.thirdparty" | ||||||||||
| APK_PATH="app/build/outputs/apk/debug/app-debug.apk" | ||||||||||
| RECOVERY_PKG="com.mentra.recovery" | ||||||||||
| LEGACY_UPDATER_PKG="com.augmentos.otaupdater" | ||||||||||
| APK_PATH="$ASG_DIR/app/build/outputs/apk/debug/app-debug.apk" | ||||||||||
|
|
||||||||||
| echo "" | ||||||||||
| echo "╔════════════════════════════════════════════════════════════════╗" | ||||||||||
| echo "║ ⚠️ WARNING ║" | ||||||||||
| echo "╠════════════════════════════════════════════════════════════════╣" | ||||||||||
| echo "║ This script will: ║" | ||||||||||
| echo "║ • Update stock ASG, BES, and MTK from latest staging ║" | ||||||||||
| echo "║ • Disable Mentra's stock asg_client ║" | ||||||||||
| echo "║ • Install your build as com.mentra.asg_client.thirdparty ║" | ||||||||||
| echo "║ • Set your build as the default launcher ║" | ||||||||||
|
|
@@ -52,24 +61,38 @@ echo "" | |||||||||
| echo "=== Mentra Live Development Setup ===" | ||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Check for ADB connection | ||||||||||
| if ! adb devices | grep -q "device$"; then | ||||||||||
| echo "ERROR: No ADB device connected." | ||||||||||
| echo "" | ||||||||||
| echo "Connect your Mentra Live using the Infinity Cable and try again." | ||||||||||
| echo "" | ||||||||||
| exit 1 | ||||||||||
| fi | ||||||||||
|
|
||||||||||
| echo "Connected device:" | ||||||||||
| adb devices | grep "device$" | ||||||||||
| resolve_serial | ||||||||||
| ADB=(adb -s "$SERIAL") | ||||||||||
| export ANDROID_SERIAL="$SERIAL" | ||||||||||
| SETUP_MUTATED=false | ||||||||||
|
|
||||||||||
| restore_stock_after_failure() { | ||||||||||
| local status=$? | ||||||||||
| trap - EXIT | ||||||||||
| if [ "$status" -ne 0 ] && [ "$SETUP_MUTATED" = true ] && "${ADB[@]}" get-state >/dev/null 2>&1; then | ||||||||||
| echo "" | ||||||||||
| echo "Setup failed; restoring the stock launcher..." >&2 | ||||||||||
| "${ADB[@]}" shell cmd package install-existing "$STOCK_PKG" >/dev/null 2>&1 || true | ||||||||||
| "${ADB[@]}" shell pm enable "$STOCK_PKG" >/dev/null 2>&1 || true | ||||||||||
| "${ADB[@]}" shell pm enable "$RECOVERY_PKG" >/dev/null 2>&1 || true | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: If setup fails after the recovery-agent step, the failure handler leaves Prompt for AI agents
Suggested change
|
||||||||||
| "${ADB[@]}" shell cmd package set-home-activity --user 0 \ | ||||||||||
| "$STOCK_PKG/com.mentra.asg_client.MainActivity" >/dev/null 2>&1 || true | ||||||||||
| "${ADB[@]}" shell am start -n \ | ||||||||||
| "$STOCK_PKG/com.mentra.asg_client.MainActivity" >/dev/null 2>&1 || true | ||||||||||
| elif [ "$status" -ne 0 ] && [ "$SETUP_MUTATED" = true ]; then | ||||||||||
| echo "Setup failed while ADB was offline." >&2 | ||||||||||
| echo "Reconnect the Infinity Cable, then run ./scripts/restore-stock.sh." >&2 | ||||||||||
| fi | ||||||||||
| exit "$status" | ||||||||||
| } | ||||||||||
| trap restore_stock_after_failure EXIT | ||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 1: Build the debug APK | ||||||||||
| echo "=== Building Debug APK ===" | ||||||||||
| echo "" | ||||||||||
| echo "Building... (this may take a minute)" | ||||||||||
| if ./gradlew assembleDebug; then | ||||||||||
| if (cd "$ASG_DIR" && ./gradlew assembleDebug); then | ||||||||||
| echo "" | ||||||||||
| echo "Build succeeded." | ||||||||||
| else | ||||||||||
|
|
@@ -88,25 +111,36 @@ fi | |||||||||
|
|
||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 2: Disable stock app | ||||||||||
| # Step 2: Put the stock firmware on a known-compatible staging baseline. | ||||||||||
| echo "=== Updating Mentra Live Firmware ===" | ||||||||||
| echo "" | ||||||||||
| ADB_SERIAL="$SERIAL" "$SCRIPT_DIR/update-stock-for-dev.sh" | ||||||||||
| SETUP_MUTATED=true | ||||||||||
|
Comment on lines
+117
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When the firmware updater fails after mutating the device while ADB is offline, this flag is still false, so the parent trap skips its restore/reconnect guidance. Mark setup as mutable before invoking the updater, or propagate the child’s mutation state. Prompt for AI agents
Suggested change
|
||||||||||
|
|
||||||||||
| # Step 3: Disable stock and its recovery agents. | ||||||||||
| echo "=== Disabling Stock App ===" | ||||||||||
| echo "" | ||||||||||
| echo "Disabling stock recovery agents..." | ||||||||||
| "${ADB[@]}" shell am force-stop "$RECOVERY_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm disable-user --user 0 "$RECOVERY_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell am force-stop "$LEGACY_UPDATER_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm disable-user --user 0 "$LEGACY_UPDATER_PKG" 2>/dev/null || true | ||||||||||
| echo "Disabling $STOCK_PKG..." | ||||||||||
| adb shell pm disable-user --user 0 "$STOCK_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm disable-user --user 0 "$STOCK_PKG" 2>/dev/null || true | ||||||||||
| echo "Stock app disabled." | ||||||||||
|
|
||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 3: Uninstall any previous dev build | ||||||||||
| # Step 4: Uninstall any previous dev build | ||||||||||
| echo "=== Removing Previous Dev Build (if any) ===" | ||||||||||
| echo "" | ||||||||||
| adb shell pm uninstall "$DEV_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm uninstall "$DEV_PKG" 2>/dev/null || true | ||||||||||
|
|
||||||||||
| # Step 4: Install new build | ||||||||||
| # Step 5: Install new build | ||||||||||
| echo "=== Installing Your Build ===" | ||||||||||
| echo "" | ||||||||||
| echo "Installing $APK_PATH..." | ||||||||||
| if adb install -g "$APK_PATH"; then | ||||||||||
| if "${ADB[@]}" install -g "$APK_PATH"; then | ||||||||||
| echo "Install succeeded." | ||||||||||
| else | ||||||||||
| echo "" | ||||||||||
|
|
@@ -116,7 +150,7 @@ fi | |||||||||
|
|
||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 5: Grant additional permissions | ||||||||||
| # Step 6: Grant additional permissions | ||||||||||
| echo "=== Granting Permissions ===" | ||||||||||
| echo "" | ||||||||||
|
|
||||||||||
|
|
@@ -140,30 +174,30 @@ PERMISSIONS=( | |||||||||
| ) | ||||||||||
|
|
||||||||||
| for perm in "${PERMISSIONS[@]}"; do | ||||||||||
| if adb shell pm grant "$DEV_PKG" "$perm" 2>/dev/null; then | ||||||||||
| if "${ADB[@]}" shell pm grant "$DEV_PKG" "$perm" 2>/dev/null; then | ||||||||||
| echo "Granted: $perm" | ||||||||||
| fi | ||||||||||
| done | ||||||||||
|
|
||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 6: Set as default home launcher | ||||||||||
| # Step 7: Set as default home launcher | ||||||||||
| echo "=== Setting as Default Launcher ===" | ||||||||||
| echo "" | ||||||||||
| # Clear any stale chooser-cached preferences for both packages so the | ||||||||||
| # "which launcher?" popup doesn't reappear. | ||||||||||
| adb shell pm clear-package-preferred-activities "$STOCK_PKG" 2>/dev/null || true | ||||||||||
| adb shell pm clear-package-preferred-activities "$DEV_PKG" 2>/dev/null || true | ||||||||||
| adb shell cmd package set-home-activity --user 0 "$DEV_PKG/com.mentra.asg_client.MainActivity" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm clear-package-preferred-activities "$STOCK_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell pm clear-package-preferred-activities "$DEV_PKG" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell cmd package set-home-activity --user 0 "$DEV_PKG/com.mentra.asg_client.MainActivity" 2>/dev/null || true | ||||||||||
| # Force the resolver to re-evaluate HOME so the new default takes effect now. | ||||||||||
| adb shell am start -a android.intent.action.MAIN -c android.intent.category.HOME 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell am start -a android.intent.action.MAIN -c android.intent.category.HOME 2>/dev/null || true | ||||||||||
| echo "Default launcher set." | ||||||||||
|
|
||||||||||
| echo "" | ||||||||||
|
|
||||||||||
| # Step 7: Launch the app | ||||||||||
| # Step 8: Launch the app | ||||||||||
| echo "=== Launching App ===" | ||||||||||
| adb shell am start -n "$DEV_PKG/com.mentra.asg_client.MainActivity" 2>/dev/null || true | ||||||||||
| "${ADB[@]}" shell am start -n "$DEV_PKG/com.mentra.asg_client.MainActivity" 2>/dev/null || true | ||||||||||
|
|
||||||||||
| echo "" | ||||||||||
| echo "=== Setup Complete ===" | ||||||||||
|
|
@@ -172,6 +206,7 @@ echo "Your build ($DEV_PKG) is now the active launcher." | |||||||||
| echo "" | ||||||||||
| echo "Useful commands:" | ||||||||||
| echo " View logs: adb logcat -s ASGClient" | ||||||||||
| echo " Reinstall: adb install -r -g $APK_PATH" | ||||||||||
| echo " Reinstall: adb -s $SERIAL install -r -g $APK_PATH" | ||||||||||
| echo " Update firmware: ./scripts/update-mentra-live.sh" | ||||||||||
| echo " Restore stock: ./scripts/restore-stock.sh" | ||||||||||
| echo "" | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -9,25 +9,23 @@ | |||||||||||||
| # ./scripts/restore-stock.sh | ||||||||||||||
| # | ||||||||||||||
|
|
||||||||||||||
| set -e | ||||||||||||||
| set -euo pipefail | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Restore aborts on grep missMedium Severity Switching Additional Locations (1)Triggered by project rule: Bugbot rules for MentraOS Reviewed by Cursor Bugbot for commit 7090220. Configure here. |
||||||||||||||
|
|
||||||||||||||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||||||||||||||
| ASG_DIR="$(cd "$SCRIPT_DIR/.." && pwd)" | ||||||||||||||
| REPO_DIR="$(cd "$ASG_DIR/.." && pwd)" | ||||||||||||||
| source "$REPO_DIR/scripts/lib/glasses-device.sh" | ||||||||||||||
|
|
||||||||||||||
| STOCK_PKG="com.mentra.asg_client" | ||||||||||||||
| DEV_PKG="com.mentra.asg_client.thirdparty" | ||||||||||||||
| RECOVERY_PKG="com.mentra.recovery" | ||||||||||||||
| OTA_URL="https://ota.mentraglass.com/prod_live_version_v2.json" | ||||||||||||||
|
|
||||||||||||||
| echo "=== Restore Stock MentraOS ===" | ||||||||||||||
| echo "" | ||||||||||||||
|
|
||||||||||||||
| # Check for ADB connection | ||||||||||||||
| if ! adb devices | grep -q "device$"; then | ||||||||||||||
| echo "ERROR: No ADB device connected." | ||||||||||||||
| echo "" | ||||||||||||||
| echo "Connect your Mentra Live using the Infinity Cable and try again." | ||||||||||||||
| exit 1 | ||||||||||||||
| fi | ||||||||||||||
|
|
||||||||||||||
| echo "Connected device:" | ||||||||||||||
| adb devices | grep "device$" | ||||||||||||||
| resolve_serial | ||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: When Prompt for AI agents
Suggested change
|
||||||||||||||
| export ANDROID_SERIAL="$SERIAL" | ||||||||||||||
| echo "" | ||||||||||||||
|
|
||||||||||||||
| # Step 1: Uninstall third-party build | ||||||||||||||
|
|
@@ -46,6 +44,7 @@ echo "=== Re-enabling Stock App ===" | |||||||||||||
| echo "" | ||||||||||||||
| adb shell pm enable "$STOCK_PKG" 2>/dev/null || true | ||||||||||||||
| adb shell cmd package install-existing "$STOCK_PKG" 2>/dev/null || true | ||||||||||||||
| adb shell pm enable "$RECOVERY_PKG" 2>/dev/null || true | ||||||||||||||
| echo "Stock app enabled." | ||||||||||||||
|
|
||||||||||||||
| echo "" | ||||||||||||||
|
|
||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,7 @@ | ||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||
| # Test BES firmware OTA update | ||||||||||||||||||||||||||||||||
| # Usage: ./scripts/test-bes-ota.sh <path-to-update_ota.bin> <target-version> | ||||||||||||||||||||||||||||||||
| # Usage: ./scripts/test-bes-ota.sh <path-to-update_ota.bin> <target-version> [--no-follow] | ||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||
| # The artifact must be the release-packaged OTA container, never raw BES build output. | ||||||||||||||||||||||||||||||||
| # Set ANDROID_SERIAL when more than one Android device may be attached. | ||||||||||||||||||||||||||||||||
|
|
@@ -11,9 +11,17 @@ set -euo pipefail | |||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| FIRMWARE_PATH="${1:-}" | ||||||||||||||||||||||||||||||||
| TARGET_VERSION="${2:-}" | ||||||||||||||||||||||||||||||||
| FOLLOW_LOGS=true | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if [ "${3:-}" = "--no-follow" ]; then | ||||||||||||||||||||||||||||||||
| FOLLOW_LOGS=false | ||||||||||||||||||||||||||||||||
| elif [ -n "${3:-}" ]; then | ||||||||||||||||||||||||||||||||
| echo "Unknown option: $3" | ||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
Comment on lines
+16
to
+21
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P3: When a caller supplies Prompt for AI agents
Suggested change
|
||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if [ -z "$FIRMWARE_PATH" ] || [ -z "$TARGET_VERSION" ]; then | ||||||||||||||||||||||||||||||||
| echo "Usage: ./scripts/test-bes-ota.sh <path-to-update_ota.bin> <target-version>" | ||||||||||||||||||||||||||||||||
| echo "Usage: ./scripts/test-bes-ota.sh <path-to-update_ota.bin> <target-version> [--no-follow]" | ||||||||||||||||||||||||||||||||
| echo "Example: ANDROID_SERIAL=0123456789ABCDEF $0 ./update_ota.bin 17.26.7.9" | ||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
@@ -36,8 +44,9 @@ for component in "${VERSION_COMPONENTS[@]}"; do | |||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| ADB=(adb) | ||||||||||||||||||||||||||||||||
| if [ -n "${ANDROID_SERIAL:-}" ]; then | ||||||||||||||||||||||||||||||||
| ADB+=( -s "$ANDROID_SERIAL" ) | ||||||||||||||||||||||||||||||||
| DEVICE_SERIAL="${ANDROID_SERIAL:-${ADB_SERIAL:-}}" | ||||||||||||||||||||||||||||||||
| if [ -n "$DEVICE_SERIAL" ]; then | ||||||||||||||||||||||||||||||||
| ADB+=( -s "$DEVICE_SERIAL" ) | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| "${ADB[@]}" get-state >/dev/null | ||||||||||||||||||||||||||||||||
|
|
@@ -52,6 +61,7 @@ else | |||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
| ARTIFACT_ID="adb-${FIRMWARE_SHA256}.bin" | ||||||||||||||||||||||||||||||||
| REMOTE_PATH="/storage/emulated/0/asg/debug_bes_${FIRMWARE_SHA256}.bin" | ||||||||||||||||||||||||||||||||
| LEGACY_REMOTE_PATH="/storage/emulated/0/asg/bes_firmware.bin" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||
| echo "🔧 BES OTA Test" | ||||||||||||||||||||||||||||||||
|
|
@@ -63,6 +73,7 @@ echo "SHA-256: $FIRMWARE_SHA256" | |||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| echo "📤 Pushing firmware to glasses..." | ||||||||||||||||||||||||||||||||
| "${ADB[@]}" shell mkdir -p /storage/emulated/0/asg | ||||||||||||||||||||||||||||||||
| "${ADB[@]}" push "$FIRMWARE_PATH" "$REMOTE_PATH" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| REMOTE_SHA256="$("${ADB[@]}" shell sha256sum "$REMOTE_PATH" | awk '{print $1}' | tr -d '\r')" | ||||||||||||||||||||||||||||||||
|
|
@@ -72,6 +83,16 @@ if [ "$REMOTE_SHA256" != "$FIRMWARE_SHA256" ]; then | |||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| # ASG 36 predates target/hash extras and always reads this fixed path. Keep both | ||||||||||||||||||||||||||||||||
| # copies so this one broadcast works with the bootstrap client and current ASG. | ||||||||||||||||||||||||||||||||
| "${ADB[@]}" shell cp "$REMOTE_PATH" "$LEGACY_REMOTE_PATH" | ||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P1: When a phone BES OTA is active, this copy overwrites its shared (Based on your team's feedback about preserving unrelated BES artifacts.) Prompt for AI agents |
||||||||||||||||||||||||||||||||
| LEGACY_REMOTE_SHA256="$("${ADB[@]}" shell sha256sum "$LEGACY_REMOTE_PATH" | awk '{print $1}' | tr -d '\r')" | ||||||||||||||||||||||||||||||||
| if [ "$LEGACY_REMOTE_SHA256" != "$FIRMWARE_SHA256" ]; then | ||||||||||||||||||||||||||||||||
| echo "❌ Device SHA-256 mismatch at legacy ASG 36 path" | ||||||||||||||||||||||||||||||||
| "${ADB[@]}" shell rm -f "$REMOTE_PATH" "$LEGACY_REMOTE_PATH" | ||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||
| echo "🚀 Triggering BES OTA..." | ||||||||||||||||||||||||||||||||
| "${ADB[@]}" logcat -c | ||||||||||||||||||||||||||||||||
|
|
@@ -82,6 +103,11 @@ echo "🚀 Triggering BES OTA..." | |||||||||||||||||||||||||||||||
| --es artifact_id "$ARTIFACT_ID" \ | ||||||||||||||||||||||||||||||||
| -n com.mentra.asg_client/.receiver.DebugBesOtaReceiver | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| if [ "$FOLLOW_LOGS" = false ]; then | ||||||||||||||||||||||||||||||||
| echo "✅ BES OTA triggered; log following disabled." | ||||||||||||||||||||||||||||||||
| exit 0 | ||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||
| echo "📋 Monitoring logs (Ctrl+C to exit)..." | ||||||||||||||||||||||||||||||||
| echo "==========================================" | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Update ASG/BES/MTK firmware on a Mentra Live that already runs the custom | ||
| # client installed by dev-setup.sh, then return to that same client and data. | ||
| # | ||
| # Usage: | ||
| # ADB_SERIAL=<serial> ./scripts/update-mentra-live.sh | ||
| # ./scripts/update-mentra-live.sh --manifest-url <https-url> | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
| exec "$SCRIPT_DIR/update-stock-for-dev.sh" --resume-thirdparty "$@" |


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: When the optional version or OTA JSON
grepfinds no match,set -o pipefailpropagates that status andset -eaborts restoration after stock may already be partially re-enabled. Guard these probes or handle their status explicitly so a missing optional field skips the update path.Prompt for AI agents