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 |
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
worked like a charm, thanks!