Showing posts with label SYNC. Show all posts
Showing posts with label SYNC. Show all posts

Wednesday, 16 February 2011

Using ADB.EXE to Capture a Bug Report (useful way to capture phone properties and logs)

I created the batch file "BugReport.cmd" so I could use the "Android Debug Bridge" to capture debug information into a date stamped filename. This captures firmware build versions, the system log (logcat), System properties, service states and much more.

First off though you need to install "ADB.EXE" and any dlls it might require. I tested this on Windows 7 (64 Bit) but can't see why this wouldn't work on WINXP or even WIN2000.

If you have install Samsung KIES or HTC Sync (or any similar sync software) you will already have a version of "ADB.EXE" installed, its easiest to either install the batch file into the same directory or make sure that the directory is listed by the "PATH" environment variable. If you can't find it you'll have to install the SDK etc.

This is "BugReport.CMD":

@echo off
setlocal
cls
echo []--------------------------------------------------------------------[]
echo ^| Generate Andoid Bug Report Version 11.047a (C) by Dennis Bareis 2011 ^|
echo []--------------------------------------------------------------------[]
echo.

@rem *** Find AD.EXE or abort *********************************************
set BatchFileDir=%~dp0
set AdbExe=%BatchFileDir%ADB.EXE
if exist "%AdbExe%" goto FoundAdbExe
set AdbExe=%CD%\ADB.EXE
if exist "%AdbExe%" goto FoundAdbExe
set AdbExe=
for %%f in ("AdbExe") do set AdbExe=%%~$PATH:f
if not "%AdbExe%" == "" FoundAdbExe
echo ERROR: Could not find "ADB.EXE" (have you installed it?)
echo.
echo To find ADB.EXE this script:
echo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo (1) Looks in the same directory as the batch file ("%BatchFileDir%)
echo.
echo (2) Looks in the current directory (%CD%)
echo.
echo (3) Looks in the PATH, that is one of the following directories: %PATH%
echo.
pause
goto :EOF
:FoundAdbExe
echo USING ADB: "%AdbExe%"
echo.

@rem *** Wait for Android to connect and display its setial number *******
set LogDir=%BatchFileDir%$BugReports$
set TmpFile=%LogDir%\SerialNumber.tmp.txt
del "%TmpFile%" >nul 2>&1
md "%LogDir%" >nul 2>&1
echo Waiting for Android Device (it must have "USB Debugging" turned ON)
"%AdbExe%" wait-for-device
"%AdbExe%" get-serialno > "%TmpFile%"
set SerialNumber=
set /p SerialNumber= < "%TmpFile%"
echo.
echo Found Android Device with serial number "%SerialNumber%"
echo.
echo.

set ReportFile=%LogDir%\Android Bug Report - %SerialNumber% (%date:/=-% @ %time::=_%).txt
echo GENERATING: "%ReportFile%"
"%AdbExe%" bugreport > "%ReportFile%" 2>&1
echo Generated Bug report, opening in notepad.
start "" "%LogDir%"
start "" notepad.exe "%ReportFile%"


Sunday, 2 January 2011

Exporting Note Everything to CSV - sick of waiting for SYNC

While Note Everything is in general a very good notepad there are two major things wrong with it:

  1. There is no sync which means all editing has to occur on the phone.
  2. They lock you in by not providing any export functions (NE GDocs only allows you to copy a single note at a time into a flat structure within Google Docs).
The first point is the most annoying but the second is my problem getting off Note Everything...

Anyway I had a look at the backup it creates and its an SQLLite DB, I downloaded the open source SQLite Database Browser and dragged the "notes.db" file onto it and viewed the "Notes" table in the "Browse Data" tab.

Using File, Export, Table as CSV file" I created a CSV which looks good. I'll probably want to clean it up depending on what I want to import it into but for now I'm happy :-)

I am now looking for a notepad that syncs notes and can import CSV files.