Search code examples
androidbatch-fileionic-frameworkhybrid-mobile-app

Batch file for building ionic android app and installing it on real device


I am creating an android hybrid app. Navigating to project folder and than running ionic build android again and again is time consuming and after the app is made go to build folder and run adb install app.apk. I have heard that batch file are useful for running such repetitive but I am new to that and do not have the time to learn it now. If anyone could just tell me how do I make a batch file to execute just the above two command by navigating to their respective folder than it would be great help. Here the second command should be executed only after the first command has been executed.


Solution

  • Create a batch file named build.bat and paste the below code. Replace {{Path to your project}} with you project location

    cd {{Path to your project}} ionic build android

    Create another batch file named installapp.bat and paste the below code. Replace {{Path to your apk}} with you your apk location

    cd {{Path to your apk}} adb install MainActivity-debug-unaligned.apk

    If your apk has some different name change it in after the install command.