I would like my user to be able to view & navigate the directories of an Android device when they click the "Browse" button, so they will be able to choose the folder where photos are stored.
As of now, I can go into the "adb shell", but I am not able to enter any more commands to interact while connected to the device via adb shell. I would like to connect to device via adb shell and cd or run other commands after connecting to the device. My current code is really horrible as I do not understand what does "stdout=subprocess.PIPE" mean and I am just following some online tutorials.
Here is my current code:
from subprocess import check_output
import subprocess
out = check_output("adb shell ls")
print out
destination = raw_input("Choose a folder: ")
p = subprocess.Popen("adb shell",stdout=subprocess.PIPE)
out, err = p.communicate()
g = subprocess.call(['cd', destination], stdout=subprocess.PIPE)
out, err = g.communicate()
print out
I appreciate any help and guides given. Thank you in advance.