Wish #CustomADBAction

Peter Simpson

Expert
Licensed User
Longtime User
Hello,
I'm requesting a new action to be added in B4A. This is just me being a bit lazy but it would be nice if B4A had #CustomADBAction.

For example when building a kiosk application in test mode, you need to install that app using ADB install -t youapp.apk, this line works in conjunction with one extra line added to the manifest file which allows you to install the application as a test app(package). It would be nice if we could just have the following in B4A, this way there would be no reason to go into a command window to use the adb command.

The following could add -t to adb install command (I presume this is how B4A installs apk files onto devices, but I'm probably incorrect)
B4X:
     #CustomADBAction: -t

But saying that, maybe if the following is used B4A would just use the #CustomADBAction in full bypassing its own commands if the action starts with adb, maybe.
B4X:
     #CustomADBAction: adb install -t youapp.apk

All this is just a though to that keep everything in B4A itself without opening up a command windows.


Enjoy...
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello Erel,
I do know about and previously looked at #CustomBuildAction. I find that the the custom action runs and works 100% perfect, but then the IDE still runs and continues to reinstall the compiled app again as showed in the compile windows (look below). If the #CustomBuildAction just had an Exit or Stop command, this would fix the issue. Actually, please let me know if there is a simple solution as I have scowered the forum and not found one. I've most probably missed a simple solution, something like #CustomBuildAction: 4, Exit... or something like that.

Running custom action. (25.61s)
Installing file to device.
The above image shows the #CustomBuildAction and installs perfect with the adb install options, but then the IDE continues and installs the file again but fails..

Basically I need an elegant way to stop the IDE continuing after the #CustomBuildAction (in this case after Step id #4). Please note, it can't be set to Step id #5 as the install fails without the adb install option(-) thus the custom build action does not run if set to Step id #5.

Is there a way to stop the IDE from continuing to install the apk file onto the device after running #CustomBuildAction.

Please note that I can and do actually stop the IDE from running by adding a second #CustomBuildAction below the first #CustomBuildAction that I actually want to use. This second #CustomBuildAction runs a batch file that causes an error, thus the IDE stops running and that means no second installation attempt, perfect. Does this work, yes it does but it's not the correct way to do things. I'm probably missing something obvious so please advise.

It would be nice if B4A had a compile option that ran and includes the #CustomBuildAction but does not try to run/install the apk file afterwards.

I do use the following line when I just want to compile without installing, but doing this followed by a #CustomBuildAction would be just perfect, maybe.
'Click to build: ide://run?File=%B4X%\B4ABuilder.exe&Args=-Task%3DBuild&Args=-BaseFolder%3D..

I've also looked at using Comment Links to run a batch file, but...

Just my 2 thoughts...


Thank you...
 
Top