Friday, August 7, 2015

Adb over wifi, no USB cable required

Assumption is you are connected to device using UART for smoething similar so that you can run few commands on device
  • Find out the IP address of the Android device: Settings -> About tablet -> Status -> IP address. Remember the IP address, of the form #.#.#.#.
  • Steps on device
    su
    stop adbd
    setprop service.adb.tcp.port 5555
    start adbd
  • Steps on host
    adb kill-server
    sudo adb start-server
    adb -a connect 192.168.1.64:5555

  • Monday, December 29, 2014

    Dump audio to wav format using mplayer

    mplayer input.mp4 -vc null -vo null -ao pcm:fast:waveheader:file=audio.wav
    

    Play raw audio using mplayer

    To play raw pcm file using mplayer use below command, which plays a pcm file "audio.pcm" whose sample rate is 192000 KHz, 32 bit, stereo
    mplayer -rawaudio rate=192000:channels=2:samplesize=4 -format s32le -demuxer rawaudio audio.pcm
    

    Friday, December 19, 2014

    How to use bash function defined in .bashrc file into bash script

    First define function in .bashrc and then export it
    d2h(){
      echo "obase=16; $@"|bc
    }
    export -f d2h
    
    Above function converts decimal to hex and then export it, so that it can be used from other bash scripts

    Wednesday, April 2, 2014

    Rescue and Recovery software


    Trinity rescue kit is good software for recovery. It can reset password also. This can be run directly from usb drive using http://www.pendrivelinux.com/universal-usb-installer-easy-as-1-2-3/
    http://trinityhome.org/

    Friday, February 15, 2013

    Use command line to get screen tap in Android


    If you want to tap on android device screen and touch is not working then you can use following command to tap screen. Suppose you want to tap 300, 500 location on screen then use following command

    adb shell input tap 300 500