[TOOL][SCRIPT]*** Easy ADB solution for screenshots in recovery HTC ONE X ***

Search This thread

Whiskey103

Senior Moderator / Member Advocate Admin / DC / RT
Staff member
Jun 6, 2009
10,012
20,442
268
44
Tell me, I’m lost . . .
www.whiskey103.nl
Oke seeing we kinda lost the possibility to use DDMS for screenshots in recovery on latest HTC Devices.
There had to be another way to do this so after few hours of google and making a few bat tests here it is.


I made a zipp (easy run me bat included) containing all the stuff needed to make screenshots in recovery.
Basically its easy and it makes use of files from this open source project http://code.google.com/p/android-fb2png/ by Kyan He
I did not write fb2png, my little script is just using it to make the shots.

Download screenshot.rar

Extract it and run the screenshot_run_me bat file.

All the bat does is running the following commands
Code:
[COLOR=Black]@[/COLOR]@echo off
cls
echo.
echo   ******************************************************
echo   *                                                    *
echo   *           ADB-Screenshot from Recovery             *
echo   *                                                    *
echo   *     Original idea: Kyan He                         *
echo   * code.google.com/p/android-fb2png                   *
echo   *                                                    *
echo   *     Script: Whiskey103                             *
echo   * forum.xda-developers.com/showthread.php?p=40260716 *
echo   *                                                    *
echo   *     Script update: Korbeny                         *
echo   *                                                    *
echo   *     ADB version: 1.0.31  (August 2013)             *
echo   *                                                    *
echo   *     Instructions:                                  *
echo   *       - Boot into recovery                         *
echo   *       - Plug in USB cable                          *
echo   *         When ready press a key to continue         *
echo   *                                                    *
echo   ******************************************************
echo.
pause
cls
adb devices
goto option
:option
cls
echo.
echo.
echo.
echo   1.- Make a screenshot
echo   2.- Exit
echo.
set /p choice=Type the number of your choice  
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto screenshot
if '%choice%'=='2' goto exit
cls
echo.
echo.
echo.
echo    "%choice%" is not a valid option. Please try again
echo.
echo.
pause
goto option
:screenshot
cls
adb shell mount /data
adb push fb2png /data/local/
adb push dump /data/local/
adb shell chmod 755 /data/local/fb2png
adb shell chmod 755 /data/local/dump
adb shell /data/local/dump
adb pull /data/local/ScreenShots
adb shell rm /data/local/fb2png
adb shell rm /data/local/dump
adb shell rm -r /data/local/ScreenShots
echo.
echo.
echo   ******************************************************
echo   *                                                    *
echo   * The screenshot was taken successfully              *
echo   *                                                    *
echo   ******************************************************
echo.
echo.
adb shell sync
adb shell umount /data
pause
goto option
:exit
cls
echo.
echo.
echo.
echo   ******************************************************
echo   *                                                    *
echo   * The screenshots are stored in the ADB folder       *
echo   * named as Screenshot_date_time.png                  *
echo   *                                                    *
echo   ******************************************************
echo.
echo.
pause
exit
But its very useful for example TWRP Themers to show their work without the hassle of using a camcorder or other cam.
Or making screenshots in Aroma, posting recovery script errors, Aroma guides etc. etc.
screenshotpng.png


screenshot3.png


Screenshots are now named/tagged with timestamps huge thx to @Patrics83 (RomCleaner author and scripting expert)
Updated script for making multiple screenshots in one cmd session thanks to @korbeny.

Maybe for future reference: if you want to decipher what settings to use to decode your Fb0, Gimp's file open dialogue is a huge help as it has some sliders to play with values while it displays the changes in realtime. @Behold_this pointed that out to me while i was searching for the right settings to shoot screenies of the older twrp (using rgb565). Later finding out about what RGB8888 means to ffmpeg was a hitch then when TWRP updated to the new pxl format.

See my pains here: DarkViper TWRP Theme (qHD) using this as a little advertiser too, maybe someone wants to grab my theme and port it to your resolution...

And here is a few output samples
fbdump.png


fbdump1.png


fbdump2.png


fbdump3.png


fbdump4.png


fbdump5.png


fbdump6.png


fbdump8.png




Disclaimer: Everybody can use my work without asking permission, all my stuff comes with a "sharing is caring" xda philosophy licence... just credits would be nice ;)
 
Last edited:

EVOuser94

Senior Member
Aug 6, 2012
1,404
665
0
Bloomsdale
How does this work!? I'm not able to get this to work with my HTC EVO 4G LTE, it says that the fb2png doesn't exist....

Code:
***********************************************
*
* ADB-Screenshot Util
* If in Recovery: Mount System
* Plug In USB Cable
* Enjoy ;)
*
***********************************************

Press any key to continue . . .
push fb2png /data/local/
failed to copy 'fb2png' to '/data/local/': Is a directory
.
shell chmod 755 /data/local/fb2png
chmod: /data/local/fb2png: No such file or directory
.
shell /data/local/fb2png /data/local/fbdump.png
/sbin/sh: /data/local/fb2png: not found
.
pull /data/local/fbdump.png
remote object '/data/local/fbdump.png' does not exist
.
***********************************************
*
* You will find screenshot in adb folder
* named as fbdump.png
*
***********************************************

Press any key to continue . . .
 

Whiskey103

Senior Moderator / Member Advocate Admin / DC / RT
Staff member
Jun 6, 2009
10,012
20,442
268
44
Tell me, I’m lost . . .
www.whiskey103.nl
How does this work!? I'm not able to get this to work with my HTC EVO 4G LTE, it says that the fb2png doesn't exist....

Code:
***********************************************
*
* ADB-Screenshot Util
* If in Recovery: Mount System
* Plug In USB Cable
* Enjoy ;)
*
***********************************************

Press any key to continue . . .
push fb2png /data/local/
failed to copy 'fb2png' to '/data/local/': Is a directory
.
shell chmod 755 /data/local/fb2png
chmod: /data/local/fb2png: No such file or directory
.
shell /data/local/fb2png /data/local/fbdump.png
/sbin/sh: /data/local/fb2png: not found
.
pull /data/local/fbdump.png
remote object '/data/local/fbdump.png' does not exist
.
***********************************************
*
* You will find screenshot in adb folder
* named as fbdump.png
*
***********************************************

Press any key to continue . . .

Hum, works for me on One X, can't think of a reason why it wouldn't work on other devices.
You get some specific error?

Sent from my HTC One X using xda premium
 

Whiskey103

Senior Moderator / Member Advocate Admin / DC / RT
Staff member
Jun 6, 2009
10,012
20,442
268
44
Tell me, I’m lost . . .
www.whiskey103.nl
I remember you told me that it works yeeears ago :D
Not bad :)

well DDMS from the android sdk worked for ages... just as of late google/htc decided to not support it in custom recovery.
so we got stuck with ugly screenshots of recovery themes.
Or it was a double work thingy.. port your theme into a device that had DDMS support and take shots there ;)
 

Whiskey103

Senior Moderator / Member Advocate Admin / DC / RT
Staff member
Jun 6, 2009
10,012
20,442
268
44
Tell me, I’m lost . . .
www.whiskey103.nl

EVOuser94

Senior Member
Aug 6, 2012
1,404
665
0
Bloomsdale
I'm getting this with that newer version.

Code:
***********************************************
*
* ADB-Screenshot Util
* If in Recovery: Mount System
* Plug In USB Cable
* Enjoy ;)
*
***********************************************

Press any key to continue . . .
push fb2png /data/local/
2167 KB/s (34628 bytes in 0.015s)
.
shell chmod 755 /data/local/fb2png
.
shell /data/local/fb2png /data/local/fbdump.png
link_image[1891]:   325 could not load needed library 'libutils.so' for '/data/l
ocal/fb2png' (link_image[1891]:   325 could not load needed library 'libcorkscre
w.so' for 'libutils.so' (reloc_library[1306]:   325 cannot locate 'tgkill'...
))CANNOT LINK EXECUTABLE
 .
pull /data/local/fbdump.png
remote object '/data/local/fbdump.png' does not exist
.
***********************************************
*
* You will find screenshot in adb folder
* named as fbdump.png
*
***********************************************

Press any key to continue . . .
 

migascalp

Senior Member
Aug 31, 2006
538
315
93
Créteil
My mod:
Code:
@echo off
echo ***********************************************
echo *
echo * ADB-Screenshot Util
echo * If in Recovery: Mount System
echo * Plug In USB Cable
echo * Enjoy ;)
echo *
echo ***********************************************
echo.
rem pause
adb shell mount /data
echo push fb2png /data/local/
adb push fb2png /data/local/
echo .
echo shell chmod 755 /data/local/fb2png
adb shell chmod 755 /data/local/fb2png
echo .
echo shell /data/local/fb2png /data/local/fbdump.png
adb shell /data/local/fb2png /data/local/fbdump.png
echo .
echo pull /data/local/fbdump.png
adb pull /data/local/fbdump.png
echo .
echo ***********************************************
echo *
echo * You will find screenshot in adb folder
echo * named as fbdump.png
echo *
echo ***********************************************
echo.
adb shell sync
adb shell umount /data
pause

Work for me
thank you again :)
 

519ljh

Senior Member
Jan 22, 2013
207
104
0
Hum, works for me on One X, can't think of a reason why it wouldn't work on other devices.
You get some specific error?

Sent from my HTC One X using xda premium

Don't work for me on One X!

---------- Post added at 10:25 AM ---------- Previous post was at 10:09 AM ----------

Don't work for me on One X!

push fb2png /data/local/
failed to copy 'fb2png' to '/data/local/': Is a directory
.
shell chmod 755 /data/local/fb2png
chmod: /data/local/fb2png: No such file or directory
.
shell /data/local/fb2png /data/local/fbdump.png
/sbin/sh: /data/local/fb2png: not found
.
pull /data/local/fbdump.png
remote object '/data/local/fbdump.png' does not exist
.
***********************************************
*
* You will find screenshot in adb folder
* named as fbdump.png
*
 

EVOuser94

Senior Member
Aug 6, 2012
1,404
665
0
Bloomsdale
Don't work for me on One X!

---------- Post added at 10:25 AM ---------- Previous post was at 10:09 AM ----------



push fb2png /data/local/
failed to copy 'fb2png' to '/data/local/': Is a directory
.
shell chmod 755 /data/local/fb2png
chmod: /data/local/fb2png: No such file or directory
.
shell /data/local/fb2png /data/local/fbdump.png
/sbin/sh: /data/local/fb2png: not found
.
pull /data/local/fbdump.png
remote object '/data/local/fbdump.png' does not exist
.
***********************************************
*
* You will find screenshot in adb folder
* named as fbdump.png
*

Try to edit the .bat file to mount the /data first before anything else takes place. Look at the post above yours, he shows how to mount the data

Sent from my EVO using xda premium
 
  • Like
Reactions: Whiskey103

Whiskey103

Senior Moderator / Member Advocate Admin / DC / RT
Staff member
Jun 6, 2009
10,012
20,442
268
44
Tell me, I’m lost . . .
www.whiskey103.nl
Whiskey any idea what could be going on with the EVO 4G LTE not working with this? I'm still unable to use this

Sent from my EVO using xda premium

Well honestly no idea. Only thing i can come up with is that you are using stuff posted in one x section on your EVO 4G LTE :p

But i think it needs different parameters inside fb2png :(
Jotha is kinda facing the same on HTC One. Scrambled shots.
But i will try to dig into it, problem is there is not much information on who wrote fb2png so can be difficult to gather more settings/parameters etc.

Sent from my HTC One X using xda premium
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 81
    Oke seeing we kinda lost the possibility to use DDMS for screenshots in recovery on latest HTC Devices.
    There had to be another way to do this so after few hours of google and making a few bat tests here it is.


    I made a zipp (easy run me bat included) containing all the stuff needed to make screenshots in recovery.
    Basically its easy and it makes use of files from this open source project http://code.google.com/p/android-fb2png/ by Kyan He
    I did not write fb2png, my little script is just using it to make the shots.

    Download screenshot.rar

    Extract it and run the screenshot_run_me bat file.

    All the bat does is running the following commands
    Code:
    [COLOR=Black]@[/COLOR]@echo off
    cls
    echo.
    echo   ******************************************************
    echo   *                                                    *
    echo   *           ADB-Screenshot from Recovery             *
    echo   *                                                    *
    echo   *     Original idea: Kyan He                         *
    echo   * code.google.com/p/android-fb2png                   *
    echo   *                                                    *
    echo   *     Script: Whiskey103                             *
    echo   * forum.xda-developers.com/showthread.php?p=40260716 *
    echo   *                                                    *
    echo   *     Script update: Korbeny                         *
    echo   *                                                    *
    echo   *     ADB version: 1.0.31  (August 2013)             *
    echo   *                                                    *
    echo   *     Instructions:                                  *
    echo   *       - Boot into recovery                         *
    echo   *       - Plug in USB cable                          *
    echo   *         When ready press a key to continue         *
    echo   *                                                    *
    echo   ******************************************************
    echo.
    pause
    cls
    adb devices
    goto option
    :option
    cls
    echo.
    echo.
    echo.
    echo   1.- Make a screenshot
    echo   2.- Exit
    echo.
    set /p choice=Type the number of your choice  
    if not '%choice%'=='' set choice=%choice:~0,1%
    if '%choice%'=='1' goto screenshot
    if '%choice%'=='2' goto exit
    cls
    echo.
    echo.
    echo.
    echo    "%choice%" is not a valid option. Please try again
    echo.
    echo.
    pause
    goto option
    :screenshot
    cls
    adb shell mount /data
    adb push fb2png /data/local/
    adb push dump /data/local/
    adb shell chmod 755 /data/local/fb2png
    adb shell chmod 755 /data/local/dump
    adb shell /data/local/dump
    adb pull /data/local/ScreenShots
    adb shell rm /data/local/fb2png
    adb shell rm /data/local/dump
    adb shell rm -r /data/local/ScreenShots
    echo.
    echo.
    echo   ******************************************************
    echo   *                                                    *
    echo   * The screenshot was taken successfully              *
    echo   *                                                    *
    echo   ******************************************************
    echo.
    echo.
    adb shell sync
    adb shell umount /data
    pause
    goto option
    :exit
    cls
    echo.
    echo.
    echo.
    echo   ******************************************************
    echo   *                                                    *
    echo   * The screenshots are stored in the ADB folder       *
    echo   * named as Screenshot_date_time.png                  *
    echo   *                                                    *
    echo   ******************************************************
    echo.
    echo.
    pause
    exit
    But its very useful for example TWRP Themers to show their work without the hassle of using a camcorder or other cam.
    Or making screenshots in Aroma, posting recovery script errors, Aroma guides etc. etc.
    screenshotpng.png


    screenshot3.png


    Screenshots are now named/tagged with timestamps huge thx to @Patrics83 (RomCleaner author and scripting expert)
    Updated script for making multiple screenshots in one cmd session thanks to @korbeny.

    Maybe for future reference: if you want to decipher what settings to use to decode your Fb0, Gimp's file open dialogue is a huge help as it has some sliders to play with values while it displays the changes in realtime. @Behold_this pointed that out to me while i was searching for the right settings to shoot screenies of the older twrp (using rgb565). Later finding out about what RGB8888 means to ffmpeg was a hitch then when TWRP updated to the new pxl format.

    See my pains here: DarkViper TWRP Theme (qHD) using this as a little advertiser too, maybe someone wants to grab my theme and port it to your resolution...

    And here is a few output samples
    fbdump.png


    fbdump1.png


    fbdump2.png


    fbdump3.png


    fbdump4.png


    fbdump5.png


    fbdump6.png


    fbdump8.png




    Disclaimer: Everybody can use my work without asking permission, all my stuff comes with a "sharing is caring" xda philosophy licence... just credits would be nice ;)
    7
    For the ppl that wanted a solution for making screenshots in recovery on HTC ONE M7
    http://www.whiskey103.nl/x/screenshotutil/ScreenshotFFMPEG_M7.rar

    thx to Sneakyghost for the ffmpeg values
    extract en run the batfile
    Its runs the following code:

    Code:
    @echo off
    echo ********************************************
    echo *                                          *
    echo *      ADB-Screenshot Util                 *
    echo *      Boot into Recovery                  *
    echo *      Plug In USB Cable                   *
    echo *      Enjoy ;)                            *
    echo *                                          *
    echo ********************************************
    echo.
    pause
    echo.
    adb kill-server -d >nul 2>&1
    adb pull /dev/graphics/fb0 fb0
    ffmpeg -vframes 1 -f rawvideo -pix_fmt rgba -s 1088x1920 -i fb0 screenshot.png
    del fb0
    echo.
    echo ********************************************
    echo *                                          *
    echo *     Output saved as screenshot.png       *
    echo *                                          *
    echo ********************************************
    echo.
    pause
    6
    Oke guys/gals.. by popular demand :)
    Screenshots are now named/tagged with timestamps huge thx to @Patrics83 (RomCleaner author and scripting expert)


    screenshot3.png
    5
    My mod:
    Code:
    @echo off
    echo ***********************************************
    echo *
    echo * ADB-Screenshot Util
    echo * If in Recovery: Mount System
    echo * Plug In USB Cable
    echo * Enjoy ;)
    echo *
    echo ***********************************************
    echo.
    rem pause
    adb shell mount /data
    echo push fb2png /data/local/
    adb push fb2png /data/local/
    echo .
    echo shell chmod 755 /data/local/fb2png
    adb shell chmod 755 /data/local/fb2png
    echo .
    echo shell /data/local/fb2png /data/local/fbdump.png
    adb shell /data/local/fb2png /data/local/fbdump.png
    echo .
    echo pull /data/local/fbdump.png
    adb pull /data/local/fbdump.png
    echo .
    echo ***********************************************
    echo *
    echo * You will find screenshot in adb folder
    echo * named as fbdump.png
    echo *
    echo ***********************************************
    echo.
    adb shell sync
    adb shell umount /data
    pause

    Work for me
    thank you again :)
    4
    Ow well, I will try to come up with something.
    Might get some unforseen help from Patrics83 but can't promise anything though.


    Sent from my HTC One X using xda premium

    Consider it as done :D

    Sending you a test file now ;)

    Screenshot_2013_04_22_15.22.46.png
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone