@davoodmehraban89 / LifeMate / commits / 347d1b5
Fork 0

LifeMate — Personal, Family & Learning Companion

fix: isolate local test APK installation from existing app

Codex committed Oct 8, 2026 at 05:46 UTC 347d1b563670f09f7394b5177d612d9afe69dff1
3 files changed +16 -6
.github/workflows/local-persistence.yml
+11 -4
@@ -10,6 +10,10 @@ on:
10 permissions:
11 contents: read
12
13 +concurrency:
14 + group: local-device-persistence-${{ github.ref }}
15 + cancel-in-progress: true
16 +
17 jobs:
18 flutter-checks:
19 runs-on: ubuntu-latest
@@ -41,6 +45,8 @@ jobs:
45 needs: flutter-checks
46 runs-on: ubuntu-latest
47 timeout-minutes: 60
48 + env:
49 + ORG_GRADLE_PROJECT_lifemateLocalTest: 'true'
50 defaults:
51 run:
52 working-directory: apps/lifemate
@@ -84,13 +90,14 @@ jobs:
90 # --no-uninstall retains SharedPreferences during Flutter test teardown.
91 script: |
92 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=create --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-create.log"'
87 - adb -s emulator-5554 shell am force-stop com.example.lifemate
93 + adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
94 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=update --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-update.log"'
89 - adb -s emulator-5554 shell am force-stop com.example.lifemate
95 + adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
96 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=archive --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-archive.log"'
91 - adb -s emulator-5554 shell am force-stop com.example.lifemate
97 + adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
98 bash -eo pipefail -c 'flutter test integration_test/local_persistence_device_test.dart -d emulator-5554 --no-pub --no-uninstall --dart-define=PERSISTENCE_PHASE=verify --reporter expanded 2>&1 | tee "$RUNNER_TEMP/local-persistence-verify.log"'
93 - adb -s emulator-5554 shell am force-stop com.example.lifemate
99 + bash -eo pipefail -c 'adb -s emulator-5554 shell pm path com.example.lifemate.localtest | grep -q "^package:"'
100 + adb -s emulator-5554 shell am force-stop com.example.lifemate.localtest
101 bash -e -c 'if grep -E "Uninstalling old version|Package install error" "$RUNNER_TEMP"/local-persistence-*.log; then echo "An installation reset invalidated the persistence test."; exit 1; fi'
102 - name: Build local role-entry APK after persistence gates
103 run: flutter build apk --release --no-pub --target=lib/role_entry_main.dart
apps/lifemate/android/app/build.gradle.kts
+4 -1
@@ -4,6 +4,8 @@ plugins {
4 id("dev.flutter.flutter-gradle-plugin")
5 }
6
7 +val localTestBuild = providers.gradleProperty("lifemateLocalTest").orNull == "true"
8 +
9 android {
10 namespace = "com.example.lifemate"
11 compileSdk = flutter.compileSdkVersion
@@ -16,7 +18,8 @@ android {
18
19 defaultConfig {
20 // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
19 - applicationId = "com.example.lifemate"
21 + applicationId = if (localTestBuild) "com.example.lifemate.localtest" else "com.example.lifemate"
22 + manifestPlaceholders["applicationLabel"] = if (localTestBuild) "آرام (محلی)" else "LifeMate"
23 // You can update the following values to match your application needs.
24 // For more information, see: https://flutter.dev/to/review-gradle-config.
25 minSdk = flutter.minSdkVersion
apps/lifemate/android/app/src/main/AndroidManifest.xml
+1 -1
@@ -1,6 +1,6 @@
1 <manifest xmlns:android="http://schemas.android.com/apk/res/android">
2 <application
3 - android:label="LifeMate"
3 + android:label="${applicationLabel}"
4 android:name="${applicationName}"
5 android:fullBackupContent="@xml/local_data_backup_rules"
6 android:dataExtractionRules="@xml/local_data_extraction_rules"