[Q] Running multiple 'adb shell' commands through 'CreateProcess' on Windows PC - C++ or Other Android Development Languages

Hi All,
This query is about running 'multiple adb commands' on 'single adb shell' opened using CreateProcess.
Currently we are able to run single command on adb shell which is created using CreateProcess API. This works fine.
But our requirement is, opening up of single adb shell and executes set of adb commands on that same shell. (ie., reusing of already opened adb shell for executing further adb commands on it)
Kindly let me know if anyone has an idea on this.
Thanks and Regards,
Sridevi.

joemittu said:
Hi All,
This query is about running 'multiple adb commands' on 'single adb shell' opened using CreateProcess.
Currently we are able to run single command on adb shell which is created using CreateProcess API. This works fine.
But our requirement is, opening up of single adb shell and executes set of adb commands on that same shell. (ie., reusing of already opened adb shell for executing further adb commands on it)
Kindly let me know if anyone has an idea on this.
Thanks and Regards,
Sridevi.
Click to expand...
Click to collapse
Hi, Please let me know If you have figured out anyway. I am also looking for the same. Thanks in advance.
-Balachandar KM

Related

adb wireless problem

Hi,
I have a problem with adb wireless as documentation is very limited and I actually had no knowledge of adb whatsoever.
However, I have it up and running and I can change and list directories. I also can remove applications but I struggle with the very simple push and pull commands.
Here is what I do. First I connect to adb wireless, then I type adb shell and after that su.
Now when I try to push or pull I always get a :not found error.
Can anyone advise what I'm doing wrong?
For example: "pull /data/app/com.antivirus-2.apk " will return pull:not found
Any help is greatly appreciated as I would like to use adb wireless as my standard application for moving files from/to pc and phone.
push and pull are not ran from a shell, but as actuall ADB calls/commands.
i.e. instead of "adb shell" you do "adb push" or "adb pull".
Hope this helps
+1
Thanks very much ..... I knew that the solution must be very simple ...

Help on how to do this commands !

Hello sir! I just wana ask question on how to run commands like this
su -c /system/etc/CrossBreeder/REMOVE_TETHER_BOOST
i've seen this in the Cross Breeder thread. I just wanna try it to reduce the lag on my phone and maybe also to speed it up!
but if i came across with this unexpected problems . i really dont know how to run this commands. so i just wanna ask . how do i run commands like that? THANKS IN ADVANCE
These commands are run via a terminal emulator on your phone. For this command, your phone have to be rooted.
Alternatively, you can use adb shell. To do so, you have to download the android sdk or google for adb for just downloading the relevant part of it, then you have to run adb root to get root privileges (the adb binary can be found under Path/to/Android-SDK/platform-tools) and adb shell to get a root shell. There you have to type in /system/etc/CrossBreeder/REMOVE_TETHER_BOOST (the su -c is not needed there because you already have root privileges).

[Q] Couldn't open ADB Shell

In recovery mode, I couldn't access shell window by using adb shell command. (Referring to the attached pic)
The device has already be rooted and OS run very well.
I also checked the hierarchy of the system, system/bin/sh does exist.
So what's wrong with it, any advice welcome!
BTW, this adb file works fine with my another mobile featured with Qualcomm CPU, hence is adb file dependent on type of CPU?

Using ADB Shell commands: How can I launch and run CCLeaner to clean and then exit?

Using ADB Shell commands: How can I launch and run CCLeaner to clean and then exit?
Or is there another Android app that can be launched and run to clean phone and then exit - all done by ADB Shell commands?
I access the target phone via Wifi or 3/4G. That is why I am looking to use the ADB command set to perform the cleaning .
Please accept my thanks in advance for your reply.
Regards,
Windmolen

ADB + Linux error: device unauthorized

Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
darkouz said:
Hi
First of all, sorry for my bad english.
It has been several hours that i'm trying to find a solution to my problem.
I want to wake my nvidia shield via adb command throught network.
I installed android tools on my raspberry pi, and when i connect to it via command line everything work, i can wake up the Shield.
But when i put my command line in a bash script
Code:
#!/bin/bash
adb kill-server
adb start-server
adb connect 192.168.1.38:5555
adb shell input keyevent KEYCODE_WAKEUP
adb kill-server
i have this error :
Code:
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
I dont know why, when i am execute the command line in a bash script it can't find the rsa key, who is there and should be used.
Any ideas
Thanks in advance.
Click to expand...
Click to collapse
Normally on Windows the first time you turn on usb debugging it will pop up and ask you to accept the adb key. This is what is preventing you, I haven't had to resolve this in Linux, but essentially you need to go to C:\\Users\You\.android\ (in Windows, path will be different in Linux) and copy the file adbkey. Now you need to move it to data/misc/adb/
This will most likely require root or TWRP. Good luck, my friend.
Sent from my KYOCERA-C6745 using Tapatalk
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
darkouz said:
Hi
Thanks for your quick response.
I couldn't make the connection via USB my adb tells me that there is no emulated device. But it work with network And yeah the first time I made the connection, the authorization pop up appeared on my shield. I checked, always authorized this device.
I have the key in /root/.android on my raspberry pi
I don't think I have the access to the /data/ folder in my shield.
But what I don't understand is why when I execute the command in a terminal like that, it work and when it's from the bash script it won't work anymore
Click to expand...
Click to collapse
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
Option B would be to dump your boot.img and use Assayed's kitchen to add insecure kernel and adb direct root, then the adbkey doesn't need to be on the device.
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
darkouz said:
Yeah as you said in your previous post, i think the solution is to root the nvidia shield cause the rsa key doesny copy itself on the device.
But would you able to explain to me why if i execute those command individually in the terminal it works.
But if i put them all in a bash script that i execute it doesnt work anymore, what's the difference between those two procedure ?
Click to expand...
Click to collapse
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
RealWelder said:
How are you executing the script? There's some (hopefully) helpful info here.
https://community.spiceworks.com/topic/433656-command-not-running-in-batch-but-will-run-in-cmd
Sent from my KYOCERA-C6745 using Tapatalk
Click to expand...
Click to collapse
i m doing : sh script.sh
i m gonna read that, thanks
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
darkouz said:
I found the solution.
I don't really understand why, but adding
Code:
sleep 1
before
Code:
adb shell input keyevent KEYCODE_BACK
resolved the problem, maybe the script execution was to fast for adb to adjust, dont know.
All i know is, that works
Click to expand...
Click to collapse
Glad you got it.
Sent from my KYOCERA-C6745 using Tapatalk
sudo rm -rf /home/(username)/.android
that worked with my kde neon machine

Categories

Resources