Android Question Ami DuOS and B4A debugging

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I installed Ami DuOS on my PC and am running my App under it just fine (it has shown me some bugs in my code that do not appear when using my App on my Samsung S3 or Tab 3)

A couple of places I forgot to use dip after a number and the screens looked fine on the S3 but on in the DuOS I saw that something was wrong and fixed it.

OK now on to my question. Is it possible (has anyone tried it or is doing it) to debug using the DuOS environment?

My PC only has a hardwired internet connection so I cannot us the bridge wireless

Any help would be appreciated

Bob
 

Robert Valentino

Well-Known Member
Licensed User
Longtime User
DuOS is using a NAT address of 192.168.153.1 but for some reason B4A-Bridge is showing 10.0.3.15

I cannot figure a way to connect.

Has anyone got this working?

I have tried both their Jellybean version and Lollipop version of DuOS

I have also tried VMPlayer and installed android-x86-4.3-20130725.iso but when I run B4A-Bridge I get not connected to wireless network in My IP


BobVal
 
Upvote 0

Robert Valentino

Well-Known Member
Licensed User
Longtime User
I set the ip address to 192.168.153.1 in the IDE (using 4.3x)

And I get failed to connect make sure the bridge program is listening and in wireless mode (which it is)

Using bridge version 2.09
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
I've just started using DuOS and I encountered the same problem as yourself with regard to using Debug mode, however I'm glad to report that I have found a solution!

In my case I've got DuOS installed on the same PC (A Lenova 23" AIO Touchscreen) as B4A. I can now use Debug Mode and the WYSIWIG Designer with DuOS!

(The problem with trying to use a Wireless connection is that DuOS is using Network Address Translation, and that it doesn't seem to have any way of letting something on the network connect to an application that acts as a network server. This is a bit of drawback, perhaps they will fix it at some point, as it prevents a number of device to device apps from working. They could allow specific ports to connect for instance, just like home routers do. Just discovered that it does have such a facility, see here http://amiduos.com/support/knowledge-base/article/network-ports-forwarding-in-amiduos Now investigating B4A Bridge could be made to work via this method.)

Anyway, for debugging the solution turns out to be the use of the ADB server, so when you get it working, it thinks that you have connected via a USB link back to your PC. This is even better than using a Wireless connection as the compile/install process is much quicker. (You can also see the App logs in Release Mode, I think).

So how do you make this work? These are the basic steps:

1. Enable root mode in AMIDuOS

See here for how to do that:

http://amiduos.com/support/knowledge-base/article/enabling-adb-connection_2

This worked for me up to the last 2 step which are:

b. If adb server and AMIDuOS running in the same device, please use loop back address(127.0.0.1) instead of IP to connect it

adb kill-server

adb connect 127.0.0.1:5565

adb devices

4. adb shell (Which enables the user to execute various shell commands in AMIDuOS

a. Verify that shell shows like root@duos:/ # , which resembles AMIDuOS is rooted.

b. verify various su commands to check root permissions

In my case the command "adb devices" listed 2 devices, and the adb shell command gave an error

error: more than one device/emulator

A bit of research showed that there was a solution, using a slightly different shell command


My efforts and the solution are shown below:


C:\Android\platform-tools>adb devices -l
List of devices attached
emulator-5564 device product:duos model:AMIDuOS device:duos
127.0.0.1:5565 device product:duos model:AMIDuOS device:duos

C:\Android\platform-tools>adb shell -a
error: more than one device/emulator

C:\Android\platform-tools>adb -e shell
error: more than one emulator

C:\Android\platform-tools>adb -d shell
error: no devices found

C:\Android\platform-tools>adb -s 127.0.0.1:5565 shell
root@duos:/ #

2. Connect using the Connect button in B4A


Once I had done this, I was able to connect to AMIDUOS with the connect button. I suspect that you may need to re-run the adb commands each time you start B4A.

I could also use the WISYWIG designer too!
 
Last edited:
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
Could you tell me what you actually key into the IP address field on the connect button? I've tried 127.0.0.1 and 127.0.0.1:5565 and neither of them will connect.

Thanks
 
Upvote 0

Derek Johnson

Active Member
Licensed User
Longtime User
Could you tell me what you actually key into the IP address field on the connect button? I've tried 127.0.0.1 and 127.0.0.1:5565 and neither of them will connect.

Thanks

With a real device, there are 2 ways of getting debug info:

1. Connect to the device via TCPIP with B4ABridge installed on the device

2. Connect to the device via the USB port with a lead back to the PC.​

I have not succeeded in getting the first method to work with AMIDUOS, I can't get the debug information to display in B4A. I did make some progress in this area but not sufficient to make to make it work fully, and I do not recommend going down this route.

The method I documented previously was a virtual method of using option 2. With this method you disconnect the B4A bridge, and use the ADB server. It works very well and seems 100% reliable.

Derek
 
Upvote 0

peggjones

Active Member
Licensed User
Longtime User
Thanks for your help. I'm afraid I can't get it to work though! Think I'll just buy a cheap Android stick and do things that way!
 
Upvote 0
Top