I have different product flavors of my app and I build them with fastlane. This is my fastfile:
default_platform(:android)
platform :android do
desc "Release apk with different urls"
lane :release do
gradle(
task: "assemble",
build_type: "release",
flavor: "flavorname",
print_command: true,
properties: {
"android.injected.signing.store.file" => "Key.jks",
"android.injected.signing.store.password" => "KeyPass",
"android.injected.signing.key.alias" => "KeyAlias",
"android.injected.signing.key.password" => "KeyPass"
}
)
end
end
The problem is apk files are created in project directory.
(projectname/app/build/outputs/apk/flavorname/release/app-flavorname-release.apk)
How to move this apk files to my Desktop automatically?
I use the following under my gradle call:
lane :release do
gradle(...)
APK_LOCATION = "#{lane_context[SharedValues::GRADLE_APK_OUTPUT_PATH]}"
sh("mv #{APK_LOCATION} ~/Desktop/")
end
The advantage of using the variable is that you will be able to use the same code for release and debug apk.
Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With