Skip to content

Instantly share code, notes, and snippets.

@pweinzettel
Created August 28, 2020 04:05
Show Gist options
  • Select an option

  • Save pweinzettel/84846b2aded058dcc3b25cd682fd6969 to your computer and use it in GitHub Desktop.

Select an option

Save pweinzettel/84846b2aded058dcc3b25cd682fd6969 to your computer and use it in GitHub Desktop.

Revisions

  1. pweinzettel created this gist Aug 28, 2020.
    26 changes: 26 additions & 0 deletions droidcam.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    #!/bin/bash
    readonly LOG_FILE=/var/log/droidcam.log
    exec 1>$LOG_FILE
    exec 2>&1

    port=4747

    date
    env
    /usr/bin/id

    function am_stop() {
    /usr/bin/adb shell am force-stop com.dev47apps.droidcamx;
    }

    function am_start() {
    /usr/bin/adb shell am start -n com.dev47apps.droidcamx/.DroidCamX;
    }

    /usr/bin/killall -9 droidcam-cli
    /usr/bin/adb kill-server
    #am_stop;
    am_start;
    sleep 2
    /usr/bin/adb forward tcp:$port tcp:$port
    /usr/bin/nohup /usr/bin/droidcam-cli adb $port &