Skip to content

Instantly share code, notes, and snippets.

@johanforssell
Created September 19, 2018 14:51
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johanforssell/f01f87c62ec1fa07bd12f25e83c5142b to your computer and use it in GitHub Desktop.
Save johanforssell/f01f87c62ec1fa07bd12f25e83c5142b to your computer and use it in GitHub Desktop.

I'm writing new versions of old apps, and thus I have inherited old app id's. In order to install AND RUN a flavor I need to do stuff manually. react-native run-android --variant appAAADebug does manage to get the app runnning (only installed)

--

My code have the package com.common.package (in source files and AndroidManifest.xml).

My build.gradle contains

    buildTypes {
        debug {
        }
        release {
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }

    flavorDimensions "appName"
    productFlavors {
        appAAA {
            dimension "appName"
            applicationId "com.AAA.app"
            versionCode 100
            versionName "3.0.0"
        }
        appBBB {
            dimension "appName"
            applicationId "com.BBB.app"
            versionCode 100
            versionName '3.0.0'
        }
    }

First the app can be installed with gradlew

cd android && ./gradlew installAppBBBDebug

The I can start it manually with

adb -s emulator-5554 shell am start -n com.BBB.app/com.common.package.MainActivity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment