Wish IDE Feature, USB Install

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

I usually compile and install using USB. Currently on my desk I have 8 physical devices, ranging from samsung, Pixel, OnePlus, and some phones from china that we resell(we work with the manufacturer). So, to install on each device I have to perform a compile. I was wondering if is would be possible to have an option(toolbar button) to open the select device to install so I can install the last compile. This may have been asked before I think(referring to B4A bridge), but I feel for USB install it would be an excellent feature and increase productivity, certainly for me anyway.

I hope my wish is granted for christmas

Regards

John
 

Peter Simpson

Expert
Licensed User
Longtime User
If you know the IP addresses of each device, you can just use custom build actions.

Build and install your app your normal way, now do the following.

Use #CustomBuildAction: 5, use adb connect (IP address) command
Use #CustomBuildAction: 5, use abd install command pointing to your APK file
Use #CustomBuildAction: 5, use adb disconnect command

Repeat 6 more.

I basically do this if I'm testing on multiple devices. You can also use build action 4 instead of 5...
 

Filippo

Expert
Licensed User
Longtime User
It's almost Christmas!
Here's the tool you need.

 

Attachments

  • APK-Installar_v1.002.zip
    11.3 KB · Views: 143

73Challenger

Active Member
Licensed User
Thank you for this! If it's not too much trouble could you post examples of the commands you use...the portion in bold text? I've searched and haven't found a reference. Thank you.


Use #CustomBuildAction: 5, use adb connect (IP address) command
Use #CustomBuildAction: 5, use abd install command pointing to your APK file
Use #CustomBuildAction: 5, use adb disconnect command
 

Peter Simpson

Expert
Licensed User
Longtime User

Something like this:

#CustomBuildAction: 4, C:\B4X_Development_Tools\Android_SDK\platform-tools\adb.exe, connect 192.168.0.205
#CustomBuildAction: 4, C:\B4X_Development_Tools\Android_SDK\platform-tools\adb.exe, install ..\Objects\si2dbarcodescanner.apk
#CustomBuildAction: 4, C:\B4X_Development_Tools\Android_SDK\platform-tools\adb.exe, disconnect
After this, repeat the above but with another device ip address.


Enjoy...
 
Last edited:

Filippo

Expert
Licensed User
Longtime User
thanks Filippo, thats pretty cool. Is it possible to share the source ?
Yes, but it is in Visual Basic.

I wrote about 10 years ago because I needed it myself. But I haven't used it for a few years now because I don't work with so many devices at the same time.

Of course you can realize the same with "CustomBuildAction", but writing 3 lines with "CustomBuildAction" in every app, for every device, is too much for me.
 

Attachments

  • APK-Installar_v1.002.zip
    131.9 KB · Views: 157

Jmu5667

Well-Known Member
Licensed User
Longtime User
Thank you, and yes, doing custom builds it not an option for me either. I may do a rewrite in B4J(share it I will) if I can do multiple adb installs at the same time.
 

Peter Simpson

Expert
Licensed User
Longtime User
It's almost Christmas!
Here's the tool you need.

View attachment 148378
Nice one @Filippo,
I was considering creating a B4J version of this but I would have wanted to connect to android devices completely wirelessly and not via USB. My plan was (and still is) to have ip addresses in a list and just tick the ip addresses that I need thus no limit.

Looking at your screenshot it looks like @Jmu5667 would need to purchase a 10 port USB hub for 8 devices, but your app works and that's all that really matters.
 

Filippo

Expert
Licensed User
Longtime User
Looking at your screenshot it looks like @Jmu5667 would need to purchase a 10 port USB hub for 8 devices
The cost of a USB hub is not that high, so that shouldn't be a problem.
It would probably be better to use the IP addresses, but I've never needed it.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…