What is the default working directory for adb push / pull and how to change it?

I pulled out a file with sdcard android using adb and it seems that it goes to c:\documents and settings\userName by default. I do not know how it was installed in this folder, since it is not the one where adb is installed, but it probably has something to do with the fact that the workspace and .android folders are here. How to change this default location for pull command for adb?

+4
source share
3 answers

The default directory for adb pull or adb push is represented by the current directory (aka . ). If you run a command like the following without specifying the target directory

 adb pull /boot.txt 

the file (if it exists) will be copied to the current directory.

Windows users:

Note the following: if you are using Windows (Vista or later), there is a chance that if the current directory requires elevated write privileges, Windows will quietly replicate the directory structure of your current directory in a special folder called VirtualStore and copy your files.

The full path for VirtualStore : %LOCALAPPDATA%\VirtualStore , which will most likely go to C:\Users\<account_name>\AppData\Local\VirtualStore .

So in the following scenario

 C:\> cd "C:\Program Files (x86)\MyCustomADBInstallLocation" C:\Program Files (x86)\MyCustomADBInstallLocation> adb pull /boot.txt 

your boot.txt file will be in this folder

 C:\Users\<account_name>\AppData\Local\VirtualStore\Program Files (x86)\MyCustomADBInstallLocation\ 
+21
source

you can specify destination location for adb push/pull , see example: -

adb click a.txt / data / local

adb pull / data / local / a.txt.

. means current directory.

or

adb pull / data / local / a.txt C: \

Hope this helps.

+5
source

I am using linux and noticed that if I opened the terminal as root, @home opened it. when I pull out the items, it is uploaded to this repository, which means my "home" directory. will try to open the terminal in another folder and run adb from there to see if the dump file for the terminal folder opens.

0
source

Source: https://habr.com/ru/post/1498310/


All Articles