I need to access the android phone connected to remote windows/linux machine to run automation script. is there any way we can execute adb commands? Please suggest me..
-
I don't understand, Do you want access to Linux from android or access to android from linux ? – JMBise Nov 05 '12 at 09:00
-
i want to access android phone connected to windows/linux machine. we have a requirement as, a android phone will be connected to some machine and i need to access it from my local windows machine to run automation. My current scripts have adb commands and i have used Robotium to automate android application – Kumar Nov 05 '12 at 09:04
-
Which kind of access do you want ? – JMBise Nov 05 '12 at 09:17
-
1adb access. we need to execute instrument commands, install/uninstall apps, etc. – Kumar Nov 05 '12 at 09:21
3 Answers
Here is the answer, to access android devices remotely, phone has to be rooted to get full control.
We need to execute the command –> adb tcpip port_number from the machine which connects the device via USB cable, (port may be any odd port between 5554 to 6000, which should not conflict with other ports assigned) in order to assign a specific port to connected device. Then from any computer , we can connect like adb connect ip_addres_of_phone:port number

- 21
- 1
in your shell script
adb shell "command"
maybe adb command will be not available, to have that command available you have to download the android SDK and then add in your path environment variable
;/android-sdk-path/tools;/android-sdk-path/platform-tools
WARNING dont replace your path environment variable with that but add it to the end of the current string.

- 680
- 4
- 19
-
If this answers the question, you should accept it as the answer (click the tick to the left of the question). – JMBise Nov 05 '12 at 10:10
-
Actually its a partial answer, but it helped me to get into answer. But thanx a lot for giving heads up. – Kumar Nov 06 '12 at 12:33
You need to download a vnc client on your pc (such as UltraVNC or TightVNC) and a vnc server on your android device. As vnc server, try alpha vnc lite from the Play Store. It doesn’t require root and works on almost all Android devices out of the box.

- 11
- 1