Android Tutorial [B4X] Builder command line script

Hi all,

Attached are txt files that are really windows .bat files. These are to help with building multiple libraries.

If you are building a large project with multiple libraries it can get hard to manage the compilation of everything.

The command line builders are your friend in such cases.

Over time I've built a helper batch file. The main advantage of this is that it will stop trying to compile further projects, if the previous one failed.
This saves time and makes it more obvious as to which library compilation failed. It also handles the folder issues that the builder has.

Documentation is included in the scripts. You basically set the path to the builder, indicate the list of projects to build and run it.

I've included examples for b4a and b4j, I've not included b4i as I've not tested it, although if may well work ok.

Like I mentioned the files will need to be renamed from .txt files to .bat. files. This is because the forum doesn't allow upload of .bat files.


  • B4AExampleCompileScript.txt
    4.4 KB · Views: 109
  • B4JExampleCompileScript.txt
    4.4 KB · Views: 88

Chris Lee

Licensed User
Sorry for the delay in response, it's been a while since I checked the forum.
Anyway, regarding the folder issues:
On some machines, I've found with the command line, that if the current working directory isn't set to where the builder exe file is, the builder will error.

As an example, if my current working directory is c:\source files\MyFunProject but I'm calling the builder at:
C:\Program Files (x86)\Anywhere Software\Basic4android\B4ABuilder.exe
It would error.
Yet if I changed my working folder to C:\Program Files (x86)\Anywhere Software\Basic4android using a cd command, it would work fine.
This was annoying, because I wanted to run it without changing my current working folder.

Anyway, the script handles it, it will change the working folder, before running the builder, then restore your working folder back when it ends.