LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with ADB (Android Debug Bridge) start-server

Solved!
Go to solution

I'm building a tester whose only interface to this phone is the USB connection.  So I send and retrieve data to the device using System Exec.vi and ADB. For example:

 

cmd /c adb push rec.txt

 

or

 

cmd /c adb shell "echo 64 > /data/test1"

 

Pretty sure is not the best way but it worked for me so far.  At any rate, my trouble comes that before any of these commands can be used, I need to run the following command:

 

cmd /c adb start-server

 

but when I run that, System Exec.vi get stuck, and the only way for me to get out of it is to open a cmd window and type adb kill-server.

 

So I've been having to start the ADB server manually before I start my tests.

 

Does anyone know a way around this?

0 Kudos
Message 1 of 13
(8,999 Views)
Solution
Accepted by topic author cmarquez

On the off chance, in system exec there is an option 'wait for completion', this is set to true by defaul and is an optional setting. Have you set it to false? labview could be waiting for the cmd to finish but as its starting a server this wont happen until the server is closed

 

hope it helps 

TDarkins 

Please remember to accept any solutions and give kudos, Thanks


LV 8.6.1, LV2010,LV2011SP1, FPGA, Win7
0 Kudos
Message 2 of 13
(8,991 Views)

Thx, you're right, what I ended up doing is running with 'wait for completion' set to False and then using cmd /c tasklist in a loop waiting for adb.exe to appear in the Windows process list.

0 Kudos
Message 3 of 13
(8,987 Views)

hi, im trying to do the same thing but i am having erros while typing cmd/c, could you share your program please?

0 Kudos
Message 4 of 13
(8,909 Views)

Here's a quick example of how I got this going, not particularly proud of how this went down, but at the end it worked.

 

- First, launch the ADB server.

- Then, using tasklist wait for the adb server to appear on the process list.  This gets a bit trickey because in the processes list the ADB server and the ADB shell windows have the same name so you see to instances of "adb.exe", and have to wait for one of them to go away so I would know the adb server had truly started.

- Finally, I ran all my commands using adb shell.  If for some reason adbserver went offline and you tried to run an adb shell cmd, ADB would automatically try to re-start the server and get stuck forever (you'd have to run "adb kill-server" from a separate window to exit, 'cuz abort doesn't work in this case).  If you are running quick / manual tests it's no biggie, but if you running hour long scripts, then I'd suggest making sure adb server is running before using any other adb command.

adb.exe

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Hope this helps.

Message 5 of 13
(8,902 Views)

hi all i am in the position to use adb via pxi with pharlap ETS anyone have adb tool and adb drivers for pharlap kindly support me to get up with NI RT PXI 8106 with PharLap ETS

0 Kudos
Message 6 of 13
(7,725 Views)

Hi sunojau,

 

I'm not sure National Instruments would have created a driver for this specific application. Doing some searching online I found this universal driver that might work for you, http://adbdriver.com/downloads/ . If this is not what you are looking for I would post your question in a new thread on the LabVIEW Real-Time forums HERE to maximize your post traffic and potential that another forum member can help you.

 

 

 

------

Aaron F.

Applications Engineering

National Instruments

 

0 Kudos
Message 7 of 13
(7,684 Views)

Hi aaron,

 

Thanks for your kind reply but actually those drivers can be used only on windows machines but i need a support for NI PXI with PharLap OS kindly help me out to get that in to PXI for ADB connection with android devices

 

0 Kudos
Message 8 of 13
(7,612 Views)

Hi sunojau,

 

I don't believe National Instruments currently has support for that. What are you trying to do?

 

Thanks,

 

KingPGeorge

0 Kudos
Message 9 of 13
(7,589 Views)

Hi KingPGeorge,

 

Trying to develop an interface for android device to run ADB commands through PXI to provide a Android App automation enhancement through PXI.

 

Thanks,

Sunoj.K.N

0 Kudos
Message 10 of 13
(7,558 Views)