Wednesday, July 10, 2013

Fixing broken SSH session

Over the last two years, I experienced an annoying issue with SSH  when I worked from my notebook with remote AWS EC2 instances. If I left SSH session without activity for about 5 minutes than the session has been frozen and halted. So I had either pressing a key each minute to keep the session alive or terminating the halted  and start another one.

Luckily, today I found a solution. SSH client has an option "ServerAliveInterval" that can solve the problem. After I had added the line  ServerAliveInterval 60 to /etc/ssh/ssh_config I found my SSH sessions are kept alive for a long time even though there wasn't any activity from the both sides.



How to detect over ADB when Android device has been fully loaded

   Previously, I employed the following way:
adb -s emulator-5554 get-state
When the above command returns "device" string it means that the starting Android will finish loading in 20-30 seconds. Really, there is not any guarantees that Android will fit into this time.

In case, when more accurate estimation is required the method with reading "getprop sys.boot_completed" comes to hands. When Android GUI is about to appears on the screen the variable "sys.boot_completed" has been set to "1"