Monday, April 23, 2012

Start/Stop ADB with Trace Turned On


platform-tools $ ADB_TRACE=all ./adb.exe kill-server

system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:kill
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303039 0009
system/core/adb/transport.c::writex():writex: fd=100 len=9: 686f73743a6b696c6c host:kill
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/transport.c::readx():readx: fd=100 wanted=4 got=4
4f4b4159 OKAY
system/core/adb/adb_client.c::_adb_connect():_adb_connect: return fd 100


platform-tools $ ADB_TRACE=all ./adb.exe kill-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:kill
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: port 5037 type tcp => fd 100
system/core/adb/transport.c::writex():writex: fd=100 len=4: 30303039 0009
system/core/adb/transport.c::writex():writex: fd=100 len=9: 686f73743a6b696c6c host:kill
system/core/adb/transport.c::readx():readx: fd=100 wanted=4
system/core/adb/sysdeps_win32.c::_socket_set_errno():_socket_set_errno: unhandled value 10054
system/core/adb/transport.c::readx():readx: fd=100 error 22: Invalid argument
system/core/adb/sysdeps_win32.c::adb_close():adb_close: 100(lo-client:5037)
* server not running *


platform-tools $ ADB_TRACE=all ./adb.exe start-server
system/core/adb/adb.c::main():Handling commandline()
system/core/adb/adb_client.c::_adb_connect():_adb_connect: host:version
system/core/adb/sysdeps_win32.c::socket_loopback_client():socket_loopback_client: could not connect to tcp:5037
system/core/adb/adb_client.c::adb_connect():adb_connect: service host:start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *

Saturday, April 14, 2012

Git - Single Developer Mode

> git config --global user.name "david"
> git config --global user.email "dmak168@gmail.com"
> git config --global color.diff auto
> git config --global color.status auto
> git config --global color.branch auto

(make a repository)
> mkdir ~/Project
> cd ~/Project
> git init
> git status
> echo "Hello There!" > readme.txt
> git status
> git add readme.txt (add a new file)
> git commit
> git status
> git log

> echo "modified again" >> readme.txt
> git add readme.txt (the second add put readme.txt into staging area)
> git reset (this is to reset staging area which result in doing nothing when commit)
> git add readme.txt
> git commit (this is to commit change to the repository)
(if you don't want to use "git add" for every change you made to a file
then you can just use "git commit -a" which will by pass the staging area)

Note 1:
1. Subversion works on repository and repository is represented as number starts at 1.
2. CVS works on File and each version of file is represented as 1.1, 1.2, 1.3 ...
3. Git works on commit, each commit gets a number (SHA1 hash) - which can guarantee the content of the repository. It promises that what we put in is what we get out by using the unique hash number.

Note 2:
> git reset (will not remove your changes but just reset the staging which means cannot commit)
> git reset --hard (will reset staging and also remove your changes and put it back to its last commit)

Note 3:
In Git our working copy is a local copy which is a full repository, and the commit is a local commit.


Wednesday, April 4, 2012

Application errors notification with Logback

http://maciejwalkowiak.pl/blog/2012/04/03/application-errors-notification-with-logback/

Logback in conjunction with SLF4J provides great API and fast and powerful implementation of logging framework. Reasons why to switch to Logback from log4j are not topic of this post and they are already described in details on logback website.

Thanks to SLF4J migration tool migration from log4j api to SLF4J is super fast. I’ve decided to switch all projects to Logback and after several months I have to say that I am really satisfied with that decision.

How to install Groovy on ubuntu 10.10

http://www.code-republic.com/?p=12

note: Ubuntu uses /etc/environment to setup your environment variables