How to generate apk file in flutter application using command line with out open/use Android Studio

Zain Ahmed
2 min readMay 13, 2020

--

let start for generate apk you need some commands and some code to do .

command 1: keytool -genkey -v -keystore c:\Users\USER_NAME\key.jks -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias key

after run this command it will ask some info like

file password , full name, organization name , etc.

you can change the name of key.jks , this command store the key.jks file in given that (c:\Users\USER_NAME).

after successfully run this command you have to write some copy past code :P

Step:1. create a file in project dir android/ with name key.properties

in this file you have to write code.

storePassword=password you enter on first command

keyPassword=password you enter on first command

keyAlias=key //don’t change it

storeFile=path of the generate .jks dile

Step:2. open file android/app/build.gradle

write a code you can see in pic with comment for generate apk form command line.

Step:3. write more code in same file

after done all this code now you have to run final command from your project terminal

flutter build apk

and sit back and wait for the apk to generate .

after apk generate you can get the file from path : android/build/app/output/apk

Like Share and Subscribe to my Youtube channel.

https://youtu.be/BqcfT-BazZM

--

--

Zain Ahmed
Zain Ahmed

Written by Zain Ahmed

Hello everyone, I am Zain Anmed a software engineer by profession, passionate about trying different technologies and trying some other cool stuff.

No responses yet