LoginSignup
7
6

More than 5 years have passed since last update.

Android Studio でお手軽パッケージ名変更

Last updated at Posted at 2015-02-24

目的

Debug 版と Release 版の両方欲しい

applicationIdSuffix を使え

コメント欄からご教授頂きました

buildTypes {
    debug {
        applicationIdSuffix ".debug"
    }
}

追記:バージョン番号で判別を

アプリを分けるとどっちがどっちなのかわからなくなるので、アプリ内でバージョン番号を表示しているのであれば、バージョン番号も変更しておくとアプリが Debug か Release かの区別がつきやすくなる.

buildTypes {
    debug {
        applicationIdSuffix ".debug"
        versionNameSuffix = "d"
    }
}

packageNameSuffix は古いらしいです

Deprecated

手順

元のパッケージ名が "com.hoge.fuga.piyo" なら

android {
    defaultConfig {
        applicationId "com.hoge.fuga.piyo.debug"
    }
}

余談

ワシのアプリは百八式まであるぞ

楽天のアプリをホーム画面に並べると似たような光景になりそうですね

7
6
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
6