DEV Community 👩‍💻👨‍💻

Sávio Santos
Sávio Santos

Posted on

Generating an Ionic apk using Linux without complications

Early story

There I was, starting mobile programming in Ionic Framework with my colleagues, being the black sheep of the team: "the Linux user".
After 3 months looking for unsuccessful tutorials and getting fun with my blessed Linux, through another problem I found the solution: "use a Docker image".
    
Now, below I present how I solved the problem and I hope it works for you too.

Let's go!?

I believe that you have already installed the Ionic Framework on your system.

Open the terminal and follow the steps:

  1. Install Docker:

    sudo apt install docker
    
  2. Download the Docker image below:

    sudo docker pull kusumoto/docker-ionic-android-sdk
    

    Click to open the image creator page: Kusumoto.

  3. Make sure the image is installed:

    sudo docker images
    

Alt Text

  1. Enter this command at the root of your project to generate the apk:

    sudo docker run --rm -v $(pwd):/ionicapp kusumoto/docker-ionic-android-sdk ionic cordova build android
    

    Notice that at the end the command that really does the magic is inserted: ionic cordova build android. If you need to execute a different command, replace it.

Considerations

I use Linux Mint 19 and have not tested it on other systems, but if you have problems, report that I will try to help.
See you!!

Top comments (3)

Collapse
 
titanhero profile image
Lex • Edited on

LoL, the black sheep lol, don't worry of be the black sheep, is the most cool that ever could happen you, also I'm the black sheep, the very black sheep, but that was the best that could passed me in my life, lol, one time I were to a meet up of programmers, and from like 50 programmers I was the only that was use GnuLinux, lol, anyway cool info, never give up my friend 😁😉👍✌️

Collapse
 
savi8sant8s profile image
Sávio Santos Author

Thanks dev. 50 is too much, lol.

Collapse
 
daviddalbusco profile image
David Dal Busco

Cool stuffs 👍

Well played Savio and thx for the share 💪

🌚 Life is too short to browse without dark mode