-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-Launch android app over adb #129
Comments
What would be the adb command to launch the app? |
You would need to know the activity you're launching inside the app, but the command is adb shell something https://developer.android.com/studio/command-line/adb#am |
Right, if we can determine the activity name then at least we can run |
try (replace 'droidcam' with with 'droidcamx' for the paid app)
|
Update: I just saw this is the Linux only repo, I ran into this error on my Windows, I think it applies to Linux as well. Just remove the Windows cmd part and it should work as well. In case somebody else runs into this issue with an "Android Service Error" and the problem that the app does not start: Get your phone open the screen unlocked, then it works.
Hope this helps someone else too :) |
adb shell am start -n com.dev47apps.droidcamx/com.dev47apps.droidcamx.DroidCamX For people googling, winding up here, and wondering about the way to start droidcamx :') |
thank you @aramg & @magnusjjj! I've written a neat little shell script inspired by your adb commands, which also checks, if DroidcamX is in the foreground: #!/usr/bin/env bash
display=$(adb shell dumpsys nfc | grep 'mScreenState=' | cut --delimiter="=" -f 2)
pid=$(adb shell pidof com.dev47apps.droidcamx)
foreground=$(adb shell dumpsys activity recents | grep 'Recent #0' | cut -d= -f3 | sed 's| .*||' | cut -d: -f2)
if [ ! -z "$pid" ]; then
echo DroidcamX already running
if [ $foreground != "com.dev47apps.droidcamx" ]; then
echo "bringing DroidcamX to foreground" && adb shell am start --activity-single-top com.dev47apps.droidcamx/com.dev47apps.droidcamx.DroidCamX
else
echo "DroidcamX already in foreground"
fi
else echo "starting DroidcamX..." && adb shell am start -n com.dev47apps.droidcamx/com.dev47apps.droidcamx.DroidCamX
fi
if [ "$display" = "OFF_UNLOCKED" ]; then
echo "display off, turning on"
adb shell input keyevent 26
elif [ "$display" = "ON_UNLOCKED" ]
then echo "display on and unlocked"
elif [ "$display" = "OFF_LOCKED" ]; then
adb shell input keyevent 26
echo please unlock screen
elif [ "$display" = "ON_LOCKED" ]; then
echo please unlock screen
fi manually starting DroidcamX on my phone was super annoying, which i don't have to do anymore :) |
command for DroidCam OBS |
This is a feature that looks interesting for getting droidcam even more similar to an actual webcam.
Either autostart on phone boot, or launch via adb shell when connected to pc.
The text was updated successfully, but these errors were encountered: