Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entering ADB shell within a specific directory on the connected device using only a single line of terminal code [duplicate]

Tags:

android

shell

adb

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.

like image 912
Rstew Avatar asked Dec 08 '14 23:12

Rstew


1 Answers

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
like image 101
Al Kafri Firas Avatar answered Oct 05 '22 08:10

Al Kafri Firas