I'm trying to find a single line solution for entering a shell using ADB on an android device and going straight into a different directory.
Trying something like this
./adb shell cd /insert_dir_here
does not work.
I'm trying to find a single line solution for entering a shell using ADB on an android device and going straight into a different directory.
Trying something like this
./adb shell cd /insert_dir_here
does not work.
Following adb shell
with a command, executes it remotely and returns to the hosts shell right after that.
so ./adb shell cd /insert_dir_here
does work, but the shell exits right away.
what kind of commands do you want to execute after changing the directory?
I suggest using the command alias
followed with your series of commands:
alias myADB="cd /to/path; command1 args; command2 args; etc...."
then execute your alias in your own shell "not the adb shell"
myADB
expect
solution
adb-cmd
:
#!/usr/bin/env expect
spawn adb shell
expect "#"
send [ concat [ join $argv " " ] ]
send "\r"
interact
Then:
adb-cmd cd /data/
Likely this can be improved by someone who knows more Tcl than me.