GUI Shortcut to Execute Linux Shell Script - Android Software/Hacking General [Developers Only]

To run a shell script quickly, I open Terminal Emulator and paste command from Clipper+ archives. Is there a faster way?
I want to tap a shortcut on homescreen to execute the shell script. Is it possible without diving into app development? Any hack etc?

Script manager in combination with the sm widget. I used to use it to run reboot scripts while on ICS.
Sent from my LG-P999 using xda premium

What if I want to have a shortcut to a script to be executed with Terminal Emulator? Not in/with any other program...
This seems to be not possible.

Related

Idea for a very usefull app. Dev's needed

Hello all.
By flashing my device many times, I am always fed up to plug it and remove all the application I don't want, or open the zip file, remove the apk and resign the ROM.
What I have in mind is making a little app that show us all the applications in system/app ( easy) and them when clicking on them just like a adb shell rm system/app/myUnwantedApp.apk.
The browser is easy to program, but the command line is not easy. I tried with eStrongs and Astro, but they cannot remove the apk..
Cam someone help me or teach me how to enter a adb command line in my phone?
Thank a lot.
profete162 said:
Hello all.
By flashing my device many times, I am always fed up to plug it and remove all the application I don't want, or open the zip file, remove the apk and resign the ROM.
What I have in mind is making a little app that show us all the applications in system/app ( easy) and them when clicking on them just like a adb shell rm system/app/myUnwantedApp.apk.
The browser is easy to program, but the command line is not easy. I tried with eStrongs and Astro, but they cannot remove the apk..
Cam someone help me or teach me how to enter a adb command line in my phone?
Thank a lot.
Click to expand...
Click to collapse
You can use a terminal emulator application like Better Term etc to run shell commands. There is nothing special about adb.
The command adb shell rm is simply running the shell first and then the "rm" command. Now, depending upon the ROM that you are using, the command adb shell will give you a root shell (or not). In any case, when you use a terminal emulator, simply use the "su" command to gain super user privileges (you have to have "su" and SuperUser.apk installed).
Since you are talking about a custom ROM, I think that root access is implied.
In any case, look at programs like Android Scripting Environment. It allows you to code scripts in an interpreted language like shell script, python etc... In your case simply write a shell script with the desired "rm ...." commands and execute them after gaining superuser permissions and make sure that your /system partition is mounted in rw mode.

Stupid question

When I run under a terminal emulator, are the programs that are being run, i.e. busybox, run in the dalvik vm or are they run as elf binaries on the actual arm processor(s)?
If you use programs like su or busybox you run the native elf file. Of course you can run programs on the dalvikvm from terminal, but most of them do the same as you would start it from your launcher
Sent from my GT-I5700 using XDA App

Android Command Line Tools

Hi all, here is a package of command line tools I've put together, here's the readme with a few of the tools listed.
Android Command Line Tools
This Is Working Prefectly On Samsung Galaxy S3 'GT-I9305'
Your Phone Should Be Rooted To Perform These Steps!!!
Installation:
1. Copy The android-tools.zip To Your SD Card (Internal Or External) And Extract It
You Should Now Have A Directory Called 'android-tools'.
2. Open A Terminal On Your Phone And Type The Following
su
mkdir /data/tmp
cat /sdcard/android-tools/busybox > /data/tmp/busybox
cat /sdcard/android-tools/busybox-installer > /data/tmp/busybox-installer
cat /sdcard/android-tools/pkgs.tar > /data/tmp/pkgs.tar
cat /sdcard/android-tools/install.sh > /data/tmp/install.sh
cd /data/tmp
chmod 755 *
./install.sh
3. In Android Terminal Emulator Preferences, Set The Shell Path to '/system/bin/bash'
And Leave The Initial Command Blank.
4. Quit Terminal Emulator And Restart.
OpenSSH: ssh-keygen Save To '/data/local/home/root/.ssh/id_rsa'.
'ssh' And 'scp' Binaries Will Look For Keys In '/data/local/home/root/.ssh/'
So You Dont Need The '-i' Option, 'ssh-copy-id' Gets It From There Too.
Arduino:
There Is A Build Environment To Build And Upload Arduino Sketches With A Script Called 'arduino' To Wrap It Up
Type 'arduino --help' In Terminal To See Its Options, It Uses The Arduino-1.0 Core Library And I have Tested
Every Board And Can Confirm It Builds For All Boards Including 'micro' And 'leonardo'. It Uses 'avrdude'
'avr-libc-1.6.7' 'gcc-avr-4.5.1', I Wrote A 'arduino.nanorc' File For Writing Sketches Which Has All The
Functions And Constants Of The Arduino Core Library With The Same Colours As In The IDE.
Other Tools:
Some Other Binaries I Have Added Or Modified Are 'tar' With All Options Enabled, 'iwconfig', 'grep egrep fgrep'
With Colour And PCRE Enabled, '7zip', 'ipctool', 'shc' For Compiling Shell Scripts, 'ssh-copy-id', 'sed' With All Options
Enabled, 'macchanger', 'bootimg_baseaddr' In bash/sh, Compiled GNU 'core-utils', 'ncurses-hexedit', 'nmap', 'ngrep', 'nano'
'strace', 'gcc', 'g++', 'unpack-bootimg' In bash, 'unrar' And 'vim'.
Backtrack 5 ARM Is Configured And Ready To Go, Just 'mkdir /sdcard/Chroot'
And Copy Your bt5.img File Into It And Type 'bootbt', Then Edit The Scripts
For VNC Server 'startvnc' And 'stopvnc' To Reflect Your Screen Size, These
Are In The pkgs.tar
Replacing '/system/etc/mkshrc' With The One Included In This Package Enables Bash As Default In ADB Shell
If The Bash Binary Is Found In '/system/bin/bash' Else The Default Shell Will Drop Back To mksh.
Nano Does Not Save Through ADB Shell Using ^O Or '^X Then y' Method, Works Fine In Terminal Emulator App On Device.
There are more tools than listed above, here's the link> https://www.dropbox.com/s/yjumfljy7e1yoyc/android-tools.zip
If you're on an custom ROM and can't use the terminal emulator when you restart terminal emulator, get /system/lib/libncurses.so from stock ROM and use adb to copy it into /system/lib on your current ROM, I will fix this tomorrow.
Sent from my GT-I9305 using xda app-developers app
Please post the right link... this one is malformed.
sciurius said:
Please post the right link... this one is malformed.
Click to expand...
Click to collapse
op just updated the link, package is now ready for download again!
thank you, andreotti09!!!
greetz,
sUsH

Need Android Terminal Command Reference

Does anyone have a list or link to the android terminal command set? I found a few for Unix/Linux but some commands don't work and others I know work on Android aren't even listed. Who has a complete list of terminal commands for say the market app "Android Terminal Emmulator"
Sent from my ASUS Transformer Pad TF700T using xda app-developers app
elfaure said:
Does anyone have a list or link to the android terminal command set? I found a few for Unix/Linux but some commands don't work and others I know work on Android aren't even listed. Who has a complete list of terminal commands for say the market app "Android Terminal Emmulator"
Click to expand...
Click to collapse
The terminal emulator only emulates a terminal. The commands available depend on the programs installed on your device.
You can use the busybox documentation as a guide for the common Unix commands implemented in busybox:
http://www.busybox.net/downloads/BusyBox.html
For some commands which have a more limited implementation in Android (look into /bin), e.g. chmod, run "busybox chmod" instead of "chmod" to get the more capable version.
But you can also install more programs, or advanced versions of the commands busybox provides.
_that
Thks. With as many emails as you entertain daily, I really appreciate you taking the time to always give a detailed and educating explanation with great links.
I like Jack's explanation on wiki for his market app "Android Terminal Emulator". He says you can:
echo $PATH
then
ls -al /PATH for each PATH in $PATH to list all the commands available on your device

Need to Single-Click a sh script

I've got a sh script that when I run it kills the mediaserver process and saves lots of battery. But right now to run it I have to start Sh Script Runner, load the script, execute it, exit script runner
Can someone please show me a way to single-click from my desktop to run this script? I'm running CM7.
Thanks!

Categories

Resources