Skip to content

Instantly share code, notes, and snippets.

@pweinzettel
Created August 28, 2020 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pweinzettel/84846b2aded058dcc3b25cd682fd6969 to your computer and use it in GitHub Desktop.
Save pweinzettel/84846b2aded058dcc3b25cd682fd6969 to your computer and use it in GitHub Desktop.
Execute DroidCam on the phone and client on pc from bash
#!/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 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment