Last active
April 27, 2022 01:27
-
-
Save olesenm/06ee8cdee893c732462a to your computer and use it in GitHub Desktop.
helium shell script with normal system locations for 'adb'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# start helium server on android device - see http://www.clockworkmod.com/carbon for more details | |
# set -x | |
# try normal system locations before the local binary | |
unset adb | |
for i in /usr/bin /usr/local/bin "$(/usr/bin/dirname $0)" | |
do | |
i="$i/adb" | |
if [ -f "$i" -a -x "$i" ] | |
then | |
adb=$i | |
break | |
fi | |
done | |
if [ -e "$adb" ] | |
then | |
echo "using adb: $adb" 1>&2 | |
else | |
echo "could not resolve a path to adb ... check your installation" 1>&2 | |
exit 1 | |
fi | |
# "pm path" returns somthing like the following | |
# "package:/data/app/com.koushikdutta.backup-1.apk\r" | |
# but with a trailing carriage return that screws up the class name in dalvikvm invocation | |
# | |
echo "retrieving the class name ..." 1>&2 | |
pkg=$($adb shell pm path com.koushikdutta.backup | /usr/bin/sed -e 's/^.*://' -e 's/\r//') | |
echo "starting up helium package '$pkg'" 1>&2 | |
$adb shell << EOF | |
CLASSPATH=$pkg app_process /system/bin com.koushikdutta.shellproxy.ShellRunner2 $@ & | |
exit | |
EOF | |
# end-of-file |
Same issue as Scooby on Lubuntu 15.04, but I was able to symlink sed from /bin to /use/bin and the script worked. This was done on a live CD session so symlink at your own risk.
Thanks for this, now I run this on cron over TCP/IP to keep helium working on my devices on my lan!
worked like a charm, thanks!
Hello @jotebe
Could you please modify the script with this amazing solution?
Iam slightly a beginner and need this please 🙏
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there , for me i must add my device ( DG-310 / Doogee Voyager 2 ) , to my udev rules , i use this code for make that quick
well the "Hellium" app from Android , still waiting for "Hellium Desktop" , and now what i must do , to start my sync backups ???