Defining package name regarding buildType in cordova android project

后端 未结 1 498
遥遥无期
遥遥无期 2021-01-25 06:02

How can I define the right package name regarding my buildType ? I have this command line to build : cordova run android --device --buildType=beta

I have th

相关标签:
1条回答
  • 2021-01-25 06:42

    Create a build-extras.gradle file under platforms/android/ with the following content:

    android {
      buildTypes {
        debug {
          applicationIdSuffix ".debug"
        }
        release {
          applicationIdSuffix ".release"
        }
      }
    }
    

    I also started to read cordova 5 documentation at first, but since I am using cordova 6 I guess it doesn't work like in their documentation anymore (and I couldn't find the same page in the latest documentation).

    Edit 1: Doing this will not launch the app automatically when doing cordova run android anymore, so you will have to launch it manually using adb shell am start -n com.application.debug/com.application.MainActivity

    0 讨论(0)
提交回复
热议问题