μ°Έκ³
- https://stackoverflow.com/a/36455983
- https://developer.android.com/studio/publish/app-signing?hl=ko#secure-shared-keystore
λ¬Έμ μμ± νμμ±
κΈνκ² zero base νλ‘μ νΈλ₯Ό λ겨λ°μμ μΌμ νμμ.
μ΄κ² μ κ² λΉλ κ΄λ ¨ν΄μ μ€μ ν΄μΌνλ 건 μλλ° κ΅¬μ²΄μ μΈ λ°©λ²λ€μ νμ€νκ² μκ°μ΄ λμ§ μμ λ€ κ²μνλ©° μ°ΎμμΌ νμ.
μ΄λ²μ μ 리ν΄μ λ€μ λ²μ λλ½ μ¬ν μμ΄, λ ν€λ§€λ©΄μ λΉ λ₯΄κ² μμ νκΈ° μν΄ κΈ°λ‘ν¨.
κΈ°λ‘ λμ
- apk, aab νμΌ μ΄λ¦ μλ μμ±
- flavor/type λ³ μ€μ
- flavor/type λ³ μ¬μ΄λ ν€ μλ μ€μ
- flavor/type λ³ μ± μ΄λ¦ μλ μ€μ
- λ¦΄λ¦¬μ¦ λ²μ μ€μ
- buildFeatures μ΅μ κ°λ€
π€ μΆκ°ν κ²λ€μ΄ λ μμΌλ €λ...
app λͺ¨λ build.gralde.kts νμΌ
val keystoreProperties = Properties()
keystoreProperties.load(FileInputStream(rootProject.file("keystore.properties")))
android {
...
defaultConfig {
...
versionCode = //λ²μ μ½λ κ°
versionName = //λ²μ λ€μ κ°
...
// λΉλ μ°μΆλ¬Ό apk, aabμ μ΄λ¦ μ€μ
// λλ λ²μ λ€μ, λ²μ μ½λ κ°μ λ£λ κ±Έ μ νΈν¨.
// μ΄λ κ² μ€μ ν μ΄λ¦ λ€μ λΉλ νμ
κ°μ΄ μλμΌλ‘ λΆλλ€.
// μ) MyApp-1.0(10)-productionRelease.apk
setProperty(
"archivesBaseName",
"{μ±μ΄λ¦}-$versionName($versionCode)"
)
}
// ν€ μ¬μ΄λ μ€μ
// keysotre.properties νμΌ μμ ν΄λΉ key, value κ°λ€μ΄ μ€μ λμ΄ μλ μν
signingConfigs {
create("developeKey") {
storeFile = file(keystoreProperties["developeStoreFile"] as String)
storePassword = keystoreProperties["developeStorePassword"] as String
keyAlias = keystoreProperties["developeKeyAlias"] as String
keyPassword = keystoreProperties["developeKeyPassword"] as String
}
create("productionKey") {
storeFile = file(keystoreProperties["productionStoreFile"] as String)
storePassword = keystoreProperties["productionStorePassword"] as String
keyAlias = keystoreProperties["productionKeyAlias"] as String
keyPassword = keystoreProperties["productionKeyPassword"] as String
}
}
flavorDimensions += "server"
productFlavors {
create("develope") {
dimension = "server"
applicationIdSuffix = ".dev"
//μ¬μ΄λν€ μ€μ
signingConfig = signingConfigs.getByName("developeKey")
// develope νμ
μΌλ‘ λΉλλ κ²½μ° μ± μ΄λ¦ μ€μ
// μ΄ appNameμ AndroidManifest.xml νμΌμμ <application> μμ
// android:label="{appName}"μΌλ‘ μ°μΈλ€.
manifestPlaceholders["appName"] = "@string/app_name_dev"
}
create("production") {
dimension = "server"
signingConfig = signingConfigs.getByName("productionKey")
manifestPlaceholders["appName"] = "@string/app_name"
}
}
buildTypes {
release {
isDebuggable = false
isMinifyEnabled = true // R8 μ€ν
// R8μ λλ
νμ νλ‘κ°λ λ£°μ μ΄λ€.
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
buildFeatures {
compose = true // νμ μ
buildConfig = true // νμ μ
viewBinding = true // νμ μ
dataBinding = true // νμ μ
}
...
}
'κ³³κ°μμ μΈμ¬λλ€ > μ€λ¬΄' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[Android][Compose] Compose Canvasλ₯Ό μ΄μ©ν΄μ Dot Indicator λ§λ€κΈ° (0) | 2023.10.28 |
---|---|
[Android][DataStore] DataStore λκΈ°μ μΌλ‘ μ°κΈ° (0) | 2023.10.08 |
[Android][Compose][μ½μ§ κ΅ν] Compose Migration + Expandable List (0) | 2023.02.23 |
[Kotlin] Calendar extensions (0) | 2023.01.12 |
[Android][Kotlin] μ¬μ©μκ° μ νν νμ 문ꡬμ λ³Όλ μ²λ¦¬ (0) | 2023.01.12 |