Android recording a device screen

$ adb shell screenrecord /sdcard/demo.mp4
$ adb shell
shell@ $ screenrecord --verbose /sdcard/demo.mp4
(press Ctrl-C to stop)
shell@ $ exit
$ adb pull /sdcard/demo.mp4
http://developer.android.com/tools/help/adb.html#screenrecord

Create the Start/stop Script on Ubuntu

sudo cp /etc/init.d/skeleton /etc/init.d/mydaemon
sudo chmod +x /etc/init.d/mydaemon
sudo vi /etc/init.d/mydaemon
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="Description of the service"
NAME=daemonexecutablename
DAEMON=/usr/bin/$NAME
DAEMON_ARGS="--options args"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME

Install Daemonize on ubuntu

$ git clone git://github.com/bmc/daemonize.git

$ sh configure
$ make
$ sudo make install

Install C Compiler on Ubuntu

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install build-essential
$ gcc -v
$ make -v

set environment path on ubuntu

  • create new file under /etc/profile.d/
    sudo vi /etc/profile.d/SCRIPT_NAME.sh
    
  • add there:
    export PATH=YOUR_PATH_WITHOUT_TRAILING_SLASH:$PATH
    
  • and give right on executable
    sudo chmod a+x /etc/profile.d/SCRIPT_NAME.sh

Edit

/etc/profile
~/.profile
~/.batchrc