[Solved] How to adb pull to any other directory than platform-tools? - Android Q&A, Help & Troubleshooting

Hi there,
The device is rooted.
I tried
Code:
adb pull /dev/block/mmcblk0p43 > /users/wenyuan/desktop/android/43.img
(mmcblk0p43 is userdata partition).
But the command was just stuck there and did not produce any results.
Would it be possible to adb pull partition (ex. userdata) to any other location than under platform-tools directory?
Would it be possible to adb pull partition even to an external disk?
Thanks.
-- Solution for internal disk--
The right code:
Code:
adb pull /dev/block/mmcblk0p43 /users/wenyuan/desktop/android/43.img
Remove ">"

do not use ">" in the command

CXZa said:
do not use ">" in the command
Click to expand...
Click to collapse
Thanks. It worked.
But would it be possible to adb pull a partition to an external disk?
I tried
Code:
adb pull /dev/block/mmcblk0p43 /Untitled/wenyuan/43.img
Untitled being the name of the external hard disk.
It did not work.

it works like this. maybe the external hard disk is not ready. also take care of fat32 file system only accept files < 4gb
if "Untitled" contains whitespaces you must quote path

aIecxs said:
it works like this. maybe the external hard disk is not ready. also take care of fat32 file system only accept files < 4gb
if "Untitled" contains whitespaces you must quote path
Click to expand...
Click to collapse
Given that,
1. in
adb pull /dev/block/mmcblk0p43 /users/wenyuan/desktop/android/43.img,
/users is under Macintosh HD; and
2. "Untitled", as an external hard disk, has the same status as Macintosh HD,
there should be some code indicating the location to "Untitied" hard disk, (ex. cd).
I tried
Code:
adb pull /dev/block/mmcblk0p43 cd /untitled/android/43.img
and it did not work.

type 'adb help' for usage
Code:
device commands:
adb push <local>... <remote>
- copy files/dirs to device
adb pull [-a] <remote>... <local>
- copy files/dirs from device
(-a preserves file timestamp and mode)
cd is cmd to change dir (unrelated to adb), don't invent fantasy usage.
btw "it did not work" is no meaningful error message. I am pretty sure the shell replied with something you can google for...

CXZa said:
do not use ">" in the command
Click to expand...
Click to collapse
Am I right in saying that
">" can not be used in "adb pull" but should be used in "adb shell su" and "adb exec-out", in case of pulling partitions? Or in any other circumstances?

Oh no, adb help and google search were no help.

https://bash.cyberciti.biz/guide/Standard_output
https://www.cyberciti.biz/faq/redirecting-stderr-to-stdout

aIecxs said:
https://bash.cyberciti.biz/guide/Standard_output
https://www.cyberciti.biz/faq/redirecting-stderr-to-stdout
Click to expand...
Click to collapse
Thanks for the links.
But I meant adb help and Google search did not help on how to adb pull device partition directly to an external disk.

refer to post #6
there is only one exact usage for adb pull
Code:
adb pull [-a] <remote>... <local>
where <local> is valid path to any directory on PC (whatever it is)
in case the command failed it will output meaningful error message. search for that error message (or post here)
what else do you expect to know?

Related

adb / push /pull not found help

Hi guys, I am trying to move some files into ext partition. I want to do it via adb but ...
It came to my attention that adb shell isn't the solution for adb push or adb pull. I need to do it via windows but whenever I do adb remount or adb kill-server and adb pull or adb push . When I input and press enter it shows an arrow I press enter cuz I dont know what I could input. It just tells me "push not found" or "adb not found" if I say adb push.
Please don't ask me what I do exactly just tell me the exact steps ^^
I would like to move Htc ime mod by jonasl by example.
Hope you will help me out guys
copy tools adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll to the .../windows/system32/
Thank's but doesn't seem to work
I tried doing : cd C:\Program Files\Android SDK
adb push C:\Program Files\Android SDK\tools\su-2.1-e-signed\system\xbin\su \system\xbin\
but this just gives me all adb commands.
Doing this inside adb shell gives me the adb : not found
Any idea/ workaround? (< only adb plz I dont want to install linux)
Code:
cd C:\Program Files\Android SDK
adb remount
adb push tools\su-2.1-e-signed\system\xbin\su \system\xbin\
Give that a try.
You can't use push or pull with shell.
The biggest problem you sill face is having spaces in the PC side path names, try moving the SDK to c:\Android_SDK if the above fails
Try this:
Code:
cd C:\Program Files\Android SDK\tools
adb remount
adb push C:\Program Files\Android SDK\tools\su-2.1-e-signed\system\xbin\su /system/xbin/
AH great, by removing the space beetwin android and sdk I managed to get out but now I am facing Out of memory error
Damn I have like 1.5 gb of memory on my ext2 partition
Where can I check the remaining memory?
EDIT : su is 22ko so I dont think memory is the big deal. However I would still like to know what is left
Maybe my microSD is dying... Any idea?
Mister-Tea said:
yy whatever, if you don't want to answer then don't but don't look high on me.
lol......
Click to expand...
Click to collapse
1/ he already answer your question
2/ it's android DEV section, your question if far away from DEV
3/ You have to learn how to use command-line application (Windows suck at this, so you should try on a linux OS)
BTW: a little how-to
cd: a great command, you'll be able to change directory (yes you have "adb" on your harddrive, but you have to tell your computer where is it)
cp : copy
mv: move
ls: list content of working directory
pwd: print current working directory
Now: let say "adb" (adb.exe) is located here: /home/carbonyle/androidSDK/tools/
launch a terminal (WindowsKey + r on windows host, then type "cmd")
Yyour working directory maybe "C:" , or whatever (/home/carbonye/ for me)
now use "cd"
Code:
cd /home/carbonyle/androidSDK/tools/
<. of course adapt this to your environnment
(use ls / pwd to convince you what you're doing)
Code:
./adb reboot recovery
<- for linux user
Code:
adb reboot recovery
<- for Win**** users
Of course this will reboot your phone into recovery mode, just adapt command to your need
Right, this thread has gone far enough with enough flaming for today.
To all of you, im disappointed and you should all know better.
PLease refrain from further flames, tidy up in progress. I am also moving this to QnA.
@ Mister-Tea
You are equally responsible for the flaming by flaming yourself.
@ you all, quit it or i will take further action.
THanks.

[Q]adb commands

I know the basic commands but I was wondering if I were to do
Adb pull /sdcard....
What command line would be needed for me to direct the contents to a folder in my adb/tools folder on my pc? I tried /sdcard backup (open folder) but it would not let me do so.
Also any great place to find a list or material for adb & busybox commands?

[Q] How to format Internal SD Card?

Hello there. I have a MyPhone A888 (4.0.4) and I was planning to wipe the Internal SD Card. How exactly do I do this? I have not rooted my phone yet also so if anyone can provide a link or tutorial as to how to root this phone, then that would be great. But really, my main question is as to how to format the internal sd card. I am not very sure yet if TWRP or CWM supports my phone since I haven't used them yet. Thanks!
Likach said:
Hello there. I have a MyPhone A888 (4.0.4) and I was planning to wipe the Internal SD Card. How exactly do I do this? I have not rooted my phone yet also so if anyone can provide a link or tutorial as to how to root this phone, then that would be great. But really, my main question is as to how to format the internal sd card. I am not very sure yet if TWRP or CWM supports my phone since I haven't used them yet. Thanks!
Click to expand...
Click to collapse
To wipe all your internal sdcard using adb (see attachment for adb folder), toggle usb debugging mode in your device then connect device to pc by usb cable and go to adb folder and open linux terminal or windows command prompt there (by right-click on any empty space while holding shift button) and enter these commands:
Code:
adb shell
rm -f /mnt/sdcard/*.*
adb kill-server
Make sure to remove your external sd card first, since in android 4.0.4 the external sd card is a part of internal sdcard
majdinj said:
To wipe all your internal sdcard using adb (see attachment for adb folder), toggle usb debugging mode in your device then connect device to pc by usb cable and go to adb folder and open linux terminal or windows command prompt there (by right-click on any empty space while holding shift button) and enter these commands:
Code:
adb shell
rm -f /mnt/sdcard/*.*
adb kill-server
Make sure to remove your external sd card first, since in android 4.0.4 the external sd card is a part of internal sdcard
Click to expand...
Click to collapse
I don't need to be rooted for this right? And I open the adb folder right then open command prompt?
Likach said:
I don't need to be rooted for this right? And I open the adb folder right then open command prompt?
Click to expand...
Click to collapse
Technically no root needed since it is not system partition that you are going to manipulate.
Open adb folder, put mouse cursor on any empty space, hold shift key, and press mouse right-click, choose open command window here and then enter the commands mentioned.
majdinj said:
Technically no root needed since it is not system partition that you are going to manipulate.
Open adb folder, put mouse cursor on any empty space, hold shift key, and press mouse right-click, choose open command window here and then enter the commands mentioned.
Click to expand...
Click to collapse
This is what appears when I do it. Is this what is supposed to show up?
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell
rm -f /mnt/sdcard/*.*
adb [email protected]:/ $ rm -f /mnt/sdcard/*.*
rm failed for -f, No such file or directory
255|[email protected]:/ $
Likach said:
This is what appears when I do it. Is this what is supposed to show up?
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell
rm -f /mnt/sdcard/*.*
adb [email protected]:/ $ rm -f /mnt/sdcard/*.*
rm failed for -f, No such file or directory
255|[email protected]:/ $
Click to expand...
Click to collapse
This message means wrong directory or verbose action.
Try to type this one:
Code:
adb shell "rm -r /mnt/sdcard/*"
If still, then can you check your device in which directory the internal sdcard is on?
majdinj said:
This message means wrong directory or verbose action.
Try to type this one:
Code:
adb shell "rm -r /mnt/sdcard/*"
If still, then can you check your device in which directory the internal sdcard is on?
Click to expand...
Click to collapse
This is what I got:
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell "rm -r /mnt/sdcard
/*"
adb server is out of date. killing...
* daemon started successfully *
rm failed for /mnt/sdcard/*, Permission denied
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>
What is the name of the folder of the Internal SD card? There is a folder here called App2SD. Is that it?
Likach said:
This is what I got:
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>adb shell "rm -r /mnt/sdcard
/*"
adb server is out of date. killing...
* daemon started successfully *
rm failed for /mnt/sdcard/*, Permission denied
C:\Users\Pabben\Desktop\Stuffs\Chrome Downloads\adb>
What is the name of the folder of the Internal SD card? There is a folder here called App2SD. Is that it?
Click to expand...
Click to collapse
Yes, the command now is correct, but you had been welcomed by "Permission denied" message. and since you are not rooted, nor cwm recovery installed (with emmc format function), so you will not be able to do it through these commands, because we will need to have mounting command to overcome the "Permission denied" message.
So what is left to do, is to do it manually (manual deleting by going to sdcard folder and delete what you can delete after showing all hidden folders)
wow this is an old thread hahah thanks for the help from July 2020

[Question][ADB] How to "adb push" with timestamps like "adb pull -a"

[Question][ADB] How to "adb push" with timestamps like "adb pull -a"
Hello, as said in the title of the post, I need to push photos to my phone but with their original timestamps. I backupped my internal storage with the command
Code:
adb pull -a -p /sdcard "PC_directory"
But I need a command to re-transfer everything back to my phone. I'd like to do this, because othewise, all the photos in my gallery will be set to the actual phone's date. Is there a way to do that? Thank you in advance!
Would also like to know if there is a solution to transfer files via adb while preserving timestamps.
You may use dd command to do a 1:1 ( bitwise ) copy of data / files - requires the source data / files are housed in an .IMG-file.
I believe you can achieve it by creating an archive with tar and output it to stdout. Then pipe it to adb exec-in with a tar command to extract it on the phone.
Update: tested it out and it seems that exec-in outputs to a file and you need to create an intermediate archive on the receiving device.

Question What do I use to backup my Samsung a7 lite gsi?

What do I use to backup my Samsung a7 lite ?
I recommend backup app that has root. If not encrypted, you can also use TWRP. but don't forget to backup Internal Storage manually
Code:
adb pull -a /sdcard
aIecxs said:
I recommend backup app that has root. If not encrypted, you can also use TWRP. but don't forget to backup Internal Storage manually
Code:
adb pull -a /sdcard
Click to expand...
Click to collapse
What do -a mean?
Swift
type 'adb help' for usage
Code:
device commands:
adb push <local>... <remote>
- copy files/dirs to device
adb pull [-a] <remote>... <local>
- copy files/dirs from device
(-a preserves file timestamp and mode)

Categories

Resources