Connecting adb over WiFi.

1) Connect your phone over USB.

2) Set the TCP port $ adb tcpip 5555.

3) Run

$ adb kill-server
$ adb connect 

you will see

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
connected to

Recording video

4) While in a shell, the syntax is screenrecord [options] <filename>.

To use screenrecord from the command line, type the following: $ adb shell screenrecord /sdcard/demo.mp4

5) (press Ctrl-C to stop)

More info on bitrate settings and stuff here :