How to make GIF from Android device screen - android

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.

Related

how should i eliminate : while pulling the folder using adb

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

Gsutil downloading Android review stats csv files as binary

I'm trying to download the review data for my Android app.
But the files gsutil downloads are not text files!
FWIW, I'm running Ubuntu 14.04 with gsutil 4.7.
Below is an example
stats$ gsutil cat gs://pubsite_prod_rev_xxxxxxxxx/stats/ratings/ratings_com.yyyyyyyyyy_201501_overview.csv
��
�#��uO�X���]]GD/ �FP_G�%�fם���9;:��
�� �5�����sv���g�T��S;�����v�jZ}�={H0B�y�cD~M�O���wC���2F����ZI��9�.p�wM�e��p�3���Rj#^�,�²Ԍ��bY�V`�jy���^�X-�p�2��b�&jg8�+�uV�|�~�N߰����xY:}��_��t�F[�,�������F���xY:}�aY�e���|U:
I just ran gsutil for the first time and saw the same thing - something that looks like binary rubbish. Except...
$ gsutil cp gs://pubsite_prod_rev_xxxx/reviews/reviews_com.yyyy.csv .
$ file reviews_com.yyyy.csv
$ reviews_com.yyyy.csv: Little-endian UTF-16 Unicode text, with very long lines
So it is text, you just need to use the right tool to view it. I managed to load it into gedit:
$ gedit reviews_com.yyyy.csv
Then save as something else. I am sure there is a better way.
It seems that the data you have in your bucket, is encrypted or some other format. I tried to download the files in same environment and it works well for me. So i would suggest check your file contents, by just downloading it manually from the bucket.
I just downloaded three .csv review files for our app and noticed the same. I'm running Mac OS X (yosemite/10.10.1) and for me the file is identified as gzipped file:
$ file Dec2014.csv
$ Dec2014.csv: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT)
I managed to turn this into readable file by adding .zip to the end of filename and unzipping it. Then it is a perfectly ok text file for, for example, TextEdit or Numbers.
It's likely utf-16 encoded. You can run this to convert on the Mac:
iconv -f UTF-16 <file>.csv
Google unfortunately makes it much more complicated to get reviews than Apple does with their RSS feeds…

Rename an APK file based on a textfile contents using Shell Scripting on a Mac

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"

How to get an image from Android YAFFS2 and be able to mount/read it?

For academic/forensic reasons I want to get an image from my SmartPhone and study it.
The File System is YAFFS2.
From adb shell and using 'cat proc/mtd' I can see that I have for partitions: system,appslog,cache,userdata.
I can get the four images using dd command, like 'dd if=/dev/mtd/mtd1 of=/mnt/sdcard/appslog.img bs=4096',
and then using pull command to get data.
-> Is it a good idea to have a format file like .img?
-> How to study (mount/ just read) these *.img files?
..I am using Ubuntu 13.10.
An .img file is less likely to be read as an image file by the Open Source forensic tool Autopsy 3.3.3 (+ Sleuth Kit) [Latest Release at the time being]. However, it can still be opened as a logical file set.Nonetheless, I suggest that you should save it in .dd format instead.

android: adb pull file path limitation for windows?

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.

Categories

Resources