diff --git a/BUILDING.md b/BUILDING.md index a774c24..18afc5f 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -4,6 +4,8 @@ This guide explains how to build TimeSafari for different platforms. ## Prerequisites +For a quick dev environment setup, use [pkgx](https://pkgx.dev). + - Node.js (LTS version recommended) - npm (comes with Node.js) - Git @@ -11,6 +13,17 @@ This guide explains how to build TimeSafari for different platforms. - For Android builds: Android Studio with SDK installed - For desktop builds: Additional build tools based on your OS +## Forks + +If you have forked this to make your own app, you'll want to customize the iOS & Android files. You can either edit existing ones, or you can remove the `ios` and `android` directories and regenerate them before the `npx cap sync` step in each setup. + + ```bash + npx cap add android + npx cap add ios + ``` + +You'll also want to edit the deep link configuration. + ## Initial Setup 1. Clone the repository: @@ -114,23 +127,20 @@ Prerequisites: macOS with Xcode installed npx cap sync ios ``` -3. Open the project in Xcode: +3. Copy the assets: ```bash - npx cap open ios + mkdir -p ios/App/App/Assets.xcassets/AppIcon.appiconset + npx capacitor-assets generate --ios ``` -4. Use Xcode to build and run on simulator or device. - -If you have forked this to make your own app, you'll want to customize the ios files: +3. Open the project in Xcode: ```bash - rm -rf ios - npx cap add ios + npx cap open ios ``` -... and then repeat the steps above. - +4. Use Xcode to build and run on simulator or device. ### Android Build @@ -150,22 +160,19 @@ Prerequisites: Android Studio with SDK installed npx cap sync android ``` -3. Open the project in Android Studio: +3. Copy the assets ```bash - npx cap open android + npx capacitor-assets generate --android ``` -3. Use Android Studio to build and run on emulator or device. - -If you have forked this to make your own app, you'll want to customize the android files: +4. Open the project in Android Studio: ```bash - rm -rf android - npx cap add android + npx cap open android ``` -... and then: repeat the steps above, and look below for the deep link configuration. +5. Use Android Studio to build and run on emulator or device. ## Building Android from the console @@ -177,6 +184,13 @@ If you have forked this to make your own app, you'll want to customize the andro npx cap run android ``` +... or, to create the `aab` file, `bundle` instead of `build`: + + ```bash + ./gradlew bundle -Dlint.baselines.continue=true + ``` + + ## Configuring Android for deep links You must add the following intent filter to the `android/app/src/main/AndroidManifest.xml` file: @@ -329,10 +343,10 @@ The packaged application will be in `dist/TimeSafari` ## Testing -Run local tests: +Run all tests (requires XCode and Android Studio/device): ```bash -npm run test-local +npm run test:all ``` See [TESTING.md](test-playwright/TESTING.md) for more details. @@ -422,3 +436,19 @@ mv time-safari/dist time-safari-dist-prev.0 && mv crowd-funder-for-time-pwa/dist - For iOS: Xcode command line tools must be installed - For Android: Correct SDK version must be installed - Check Capacitor configuration in capacitor.config.ts + + +# List all installed packages +adb shell pm list packages | grep timesafari + +# Force stop the app (if it's running) +adb shell am force-stop app.timesafari + +# Clear app data (if you don't want to fully uninstall) +adb shell pm clear app.timesafari + +# Uninstall for all users +adb shell pm uninstall -k --user 0 app.timesafari + +# Check if app is installed +adb shell pm path app.timesafari \ No newline at end of file diff --git a/android/.gradle/8.11.1/checksums/checksums.lock b/android/.gradle/8.11.1/checksums/checksums.lock deleted file mode 100644 index fd1f78f..0000000 Binary files a/android/.gradle/8.11.1/checksums/checksums.lock and /dev/null differ diff --git a/android/.gradle/8.11.1/checksums/md5-checksums.bin b/android/.gradle/8.11.1/checksums/md5-checksums.bin deleted file mode 100644 index 013dc6e..0000000 Binary files a/android/.gradle/8.11.1/checksums/md5-checksums.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/checksums/sha1-checksums.bin b/android/.gradle/8.11.1/checksums/sha1-checksums.bin deleted file mode 100644 index ac09540..0000000 Binary files a/android/.gradle/8.11.1/checksums/sha1-checksums.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/executionHistory/executionHistory.bin b/android/.gradle/8.11.1/executionHistory/executionHistory.bin deleted file mode 100644 index 56c9a8b..0000000 Binary files a/android/.gradle/8.11.1/executionHistory/executionHistory.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/executionHistory/executionHistory.lock b/android/.gradle/8.11.1/executionHistory/executionHistory.lock deleted file mode 100644 index 37677bc..0000000 Binary files a/android/.gradle/8.11.1/executionHistory/executionHistory.lock and /dev/null differ diff --git a/android/.gradle/8.11.1/fileChanges/last-build.bin b/android/.gradle/8.11.1/fileChanges/last-build.bin deleted file mode 100644 index f76dd23..0000000 Binary files a/android/.gradle/8.11.1/fileChanges/last-build.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/fileHashes/fileHashes.bin b/android/.gradle/8.11.1/fileHashes/fileHashes.bin deleted file mode 100644 index cb5d22d..0000000 Binary files a/android/.gradle/8.11.1/fileHashes/fileHashes.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/fileHashes/fileHashes.lock b/android/.gradle/8.11.1/fileHashes/fileHashes.lock deleted file mode 100644 index 00640cb..0000000 Binary files a/android/.gradle/8.11.1/fileHashes/fileHashes.lock and /dev/null differ diff --git a/android/.gradle/8.11.1/fileHashes/resourceHashesCache.bin b/android/.gradle/8.11.1/fileHashes/resourceHashesCache.bin deleted file mode 100644 index dd7c186..0000000 Binary files a/android/.gradle/8.11.1/fileHashes/resourceHashesCache.bin and /dev/null differ diff --git a/android/.gradle/8.11.1/gc.properties b/android/.gradle/8.11.1/gc.properties deleted file mode 100644 index e69de29..0000000 diff --git a/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock index 79551c9..6f5da8a 100644 Binary files a/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ diff --git a/android/.gradle/buildOutputCleanup/cache.properties b/android/.gradle/buildOutputCleanup/cache.properties index 3865c95..1cb74a9 100644 --- a/android/.gradle/buildOutputCleanup/cache.properties +++ b/android/.gradle/buildOutputCleanup/cache.properties @@ -1,2 +1,2 @@ -#Tue Mar 11 10:01:05 UTC 2025 -gradle.version=8.10.2 +#Fri Mar 21 07:27:50 UTC 2025 +gradle.version=8.2.1 diff --git a/android/.gradle/file-system.probe b/android/.gradle/file-system.probe index c49b9e9..d0da614 100644 Binary files a/android/.gradle/file-system.probe and b/android/.gradle/file-system.probe differ diff --git a/android/Gemfile b/android/Gemfile deleted file mode 100644 index 7a118b4..0000000 --- a/android/Gemfile +++ /dev/null @@ -1,3 +0,0 @@ -source "https://rubygems.org" - -gem "fastlane" diff --git a/android/app/.gitignore b/android/app/.gitignore index dac1f80..043df80 100644 --- a/android/app/.gitignore +++ b/android/app/.gitignore @@ -1,3 +1,2 @@ /build/* !/build/.npmkeep -src/main/assets/public/assets/ \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index acc7346..e53e40a 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,7 +1,7 @@ apply plugin: 'com.android.application' android { - namespace "app.timesafari" + namespace 'app.timesafari' compileSdk rootProject.ext.compileSdkVersion defaultConfig { applicationId "app.timesafari" @@ -22,17 +22,6 @@ android { proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } - lintOptions { - disable 'UnsanitizedFilenameFromContentProvider' - abortOnError false - baseline file("lint-baseline.xml") - - // Ignore Capacitor module issues - ignore 'DefaultLocale' - ignore 'UnsanitizedFilenameFromContentProvider' - ignore 'LintBaseline' - ignore 'LintBaselineFixed' - } } repositories { diff --git a/android/app/lint-baseline.xml b/android/app/lint-baseline.xml deleted file mode 100644 index 8ed44b3..0000000 --- a/android/app/lint-baseline.xml +++ /dev/null @@ -1,398 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/android/app/src/androidTest/java/app/timesafari/app/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java similarity index 68% rename from android/app/src/androidTest/java/app/timesafari/app/ExampleInstrumentedTest.java rename to android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java index 28cfc7c..632b6b1 100644 --- a/android/app/src/androidTest/java/app/timesafari/app/ExampleInstrumentedTest.java +++ b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java @@ -1,20 +1,26 @@ -package app.timesafari.app; +package com.getcapacitor.myapp; + +import static org.junit.Assert.*; import android.content.Context; -import androidx.test.platform.app.InstrumentationRegistry; import androidx.test.ext.junit.runners.AndroidJUnit4; - +import androidx.test.platform.app.InstrumentationRegistry; import org.junit.Test; import org.junit.runner.RunWith; -import static org.junit.Assert.*; - +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ @RunWith(AndroidJUnit4.class) public class ExampleInstrumentedTest { + @Test - public void useAppContext() { + public void useAppContext() throws Exception { // Context of the app under test. Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); + assertEquals("app.timesafari", appContext.getPackageName()); } -} \ No newline at end of file +} diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 06a98ee..876d7fa 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -10,19 +10,19 @@ android:theme="@style/AppTheme"> + android:theme="@style/AppTheme.NoActionBarLaunch"> - + diff --git a/android/app/src/main/assets/capacitor.config.json b/android/app/src/main/assets/capacitor.config.json index 26d38ce..dba3e9d 100644 --- a/android/app/src/main/assets/capacitor.config.json +++ b/android/app/src/main/assets/capacitor.config.json @@ -1,5 +1,5 @@ { - "appId": "app.timesafari.app", + "appId": "app.timesafari", "appName": "TimeSafari", "webDir": "dist", "bundledWebRuntime": false, diff --git a/android/app/src/main/assets/public/index.html b/android/app/src/main/assets/public/index.html index cfbe94a..9a2af5b 100644 --- a/android/app/src/main/assets/public/index.html +++ b/android/app/src/main/assets/public/index.html @@ -6,7 +6,7 @@ TimeSafari - +