How should i eliminate : while pulling the folder using adb some of the folders contain special characters? Its not supporting in windows platform.
C:\Users\Vijay\Desktop\bug_report>adb pull /data/ingenic-log
pull: building file list...
pull: /data/ingenic-log/15(2017-02-16 16:56:00)/logcat.txt -> ./15(2017-02-16 16
cannot create '.\15(2017-02-16 16:56:00)\logcat.txt': No such file or directory
Related
I am trying to copy all directories and files from an android device within a specified location
ie: /sdcard/Android/data/com.company.software/data/XXXXXXX
XXXXXXXX is all contents of directory
To a local directory C:\copied\android
when using
adb -s %%G pull "/sdcard/Android/data/com.company.software/data" C:/copied/android
It will copy the data directory and its contents and place in C:\copied\android\data\XXXXXXX
I have tried with and without the trailing / but doesn't seem to make any difference and * doesn't seem to play nice either.
what i want to occur is the contents to directly go to the C:\copied\android\ folder.
ie. C:\copied\android\XXXXXXXXX
Wondering if there is a way to do this or do I have to copy locally then move them?
Thanks
I want to download all files from /data/data/foo folder to my pc. I am using adb to connect with my phone.
cd /data/data/foo
ls -R
.:
cache
databases
files
lib
shared_prefs
./cache:
./databases:
errors.db
errors.db-journal
logs.db
logs.db-journal
./files:
cache_state.info
./shared_prefs:
LANG_CODE.xml
PPP.xml
CADD
.xml
To download files I am using:
adb pull "/data/data/foo" %USERPROFILE%/foo
And here's response:
pull: building file list...
skipping special file 'lib'
pull: /data/data/foo/files/cache_state.info -> C:\Users\root/foo/files/cache_state.info
pull: /data/data/foo/shared_prefs/CADD
.xml -> C:\Users\root/foo/shared_prefs/CADD
.xml
cannot create 'C:\Users\root\foo\shared_prefs\CADD
.xml': No such file or directory
And in fact, only this is copied:
foo/files/cache_state.info
foo/shared_prefs
What I am doing wrong here?
The problem:
What you're doing is right (the command is correct), but the problem comes from the nature of the task you're trying to achieve.
You're trying to copy files from a unix device (an ext filesystem) into your windows pc (with NTFS filesystem). This usually works fine but there are cases when it doesn't: different filesystems have different rules as to which filenames are valid, and if a filename is valid in the source but not in the destination, there's no way to copy it preserving it's name.
From the error I understand you have a file named CADD
.xml (with line break included in the name) that is valid in your android device but will give an error when trying to copy it into your windows filesystem (see Which file systems support newlines in file names?).
Possible solutions:
Copy the files one by one and set a different destination name for the file causing trouble (CADD\n.xml -> CADD.xml)
Get some ext filesystem (either create it in your disk or mount from an external disk) and copy the files there
Copy the file into the ext filesystem used by your in-windows bash shell (see How to Access Your Ubuntu Bash Files in Windows )
I am trying to take a file and rename it based on text i have in a file. Basically i have an android APK that i want to rename to name_version.apk I am using AAPT to dump the version number of the apk into a version.txt file and so the output of cat version.txt looks like this
1.0b17
So how would I go about using either cat (or some other shell command) to rename MyApp.apk to MyApp_v1.0b17.apk ?
You can use backticks to capture the output from cat into a string, like this.
`cat version.txt`
From there, you can make a simple mv command with that in the arguments.
mv "MyApp.apk" "MyApp_`cat version.txt`.apk"
I can capture Android device screen:
adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > adb-screenshot-$(date +%Y%m%d-%H%M%S).png
How can I squash all those images into single GIF?
You can use the convert command of ImageMagick to combine your .png files into one .gif animation :
convert -delay 10 -loop 0 *.png anim.gif
Ok, I found it.
First done screenshots in single folder and then converted it all to GIF like this:
convert *.png screens.gif
Installed ImageMagick as described here.
On Mac OS X, I've installed it like this: brew install ImageMagick.
You can use my fully working script here: android-screen-gif.sh.
You simply run it with ./android-screen-gif.sh, let it record and hit Ctrl + C when you want to stop.
The images will be pulled and a GIF assembled, very useful for demos/issue tracker/email!
Requires convert to be on path, see the other posts here about ImageMagick.
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png
Wrote screenshot to /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png
Downloading images.
pull: building file list...
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-5.png -> ./Screenshot-20150707-105440-5.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-4.png -> ./Screenshot-20150707-105440-4.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-3.png -> ./Screenshot-20150707-105440-3.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-2.png -> ./Screenshot-20150707-105440-2.png
pull: /sdcard/Screenshot-20150707-105440/Screenshot-20150707-105440-1.png -> ./Screenshot-20150707-105440-1.png
5 files pulled. 0 files skipped.
6077 KB/s (5015743 bytes in 0.805s)
Assembled gif Screenshot-20150707-105440.gif
Cleaned up individual screenshots.
When I pull some file from phone using adb pull, I got error like:cannot create 'some file': No such file or directory
The detail is: I create a file named "a.txt", under folder /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv, the "v....v" is a folder I create under /mnt/sdcard/dcim/100ANDRO/, then I open command terminal and switch to C:/ and run the command : C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>adb pull /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder
here: a..........a is a folder I create in C:\ disk, the v....v is the folder I create under /mnt/sdcard/dcim/100ANDRO/, the "folder...folder...folder" is the target folder I want to create.
The result is:pull: building file list...
pull: /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/a.txt -> folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolder/a.txt
cannot create 'folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderf
olderfolderfolderfolderfolderfolder\a.txt': No such file or directory
but if the target folder length is shorter, the command will success!
C:\aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaa>adb pull /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv folderfolderfolderfolderfolderfo
lderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfolderfold
pull: building file list...
pull: /mnt/sdcard/DCIM/100ANDRO/vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv/a.txt -> folderfolderfolderfolderfolderfolderfolderfolderfolder
folderfolderfolderfolderfolderfolderfolderfolderfolderfolderfold/a.txt
1 file pulled. 0 files skipped.
0 KB/s (12 bytes in 0.070s)
Why this happen? Is it a defect for adb.exe ? please help, really appreciated for that.
See the link below:
http://msdn.microsoft.com/en-us/library/aa365247.aspx
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.
Are your paths crossing 260/?
I was running into this issue with cmd.exe + 260 character group policy editor/registry fix + reboot. Once I switched to powershell I was able to adb pull my files from my phone. If that doesn't work, try git bash.