send intent to Terminal Emulator

1,022 views
Skip to first unread message

Arnaud

unread,
Sep 6, 2012, 12:56:17 PM9/6/12
to tas...@googlegroups.com
I want to send a RUN_SCRIPT intent to Android Terminal Emulator as described here:
https://github.com/jackpal/Android-Terminal-Emulator/wiki/Launching-Android-Terminal-Emulator-from-another-App

I tried the OPEN_NEW_WINDOW intent and that works fine to just open a window, but the RUN_SCRIPT intent doesn't appear to do anything.

I tried these settings in Misc -> Send Intent:

Action=jackpal.androidterm.RUN_SCRIPT
Cat=Default
Extra=jackpal.androidterm.iInitialCommand:echo foobar
Target=Activity

(the other parameters are left unchanged)

I can't see any errors in the Tasker logs.

Maybe it's a permission issue? The Terminal Emulator doc says that the app needs a specific permission to send RUN_SCRIPT.
Is there a way to send intents as root from Tasker?

Thanks

-- Arnaud

Nixx

unread,
Sep 7, 2012, 11:44:57 AM9/7/12
to tas...@googlegroups.com
Not being able to answer your question, but on a side note:
Did you find the Scripts > Run Shell action? This enables you to run any script as root without having to communicate with an emulator.


ktmom

unread,
Sep 9, 2012, 5:30:33 PM9/9/12
to tas...@googlegroups.com
Have you tried Cat=None and Target=Broadcast Receiver?

Also the link you provided says "Applications using this intent must have the jackpal.androidterm.permission.RUN_SCRIPT permission, which must be approved by the user at install time." I am not sure how you would go about providing this permission at "install time".  I take the install time to mean when the app that is sending the intent was installed, so that would be Tasker in this case.  I think that page was targeted to developers wanting to hook into the Android-Terminal-Emulator.


I would start with the simpler intent trying something like;
Send Intent [ Action:
jackpal.androidterm.OPEN_NEW_WINDOW Cat:None Mime Type: Data: Extra: Extra: Package: Class: Target:Broadcast Receiver ]

ktmom

unread,
Sep 9, 2012, 5:33:43 PM9/9/12
to tas...@googlegroups.com
Oh, and the log an error might show up in is the system log.  For this you would need aLogcat

Arnaud

unread,
Sep 11, 2012, 11:54:40 PM9/11/12
to tas...@googlegroups.com
Ok so since Tasker can not send intents as root, I successfully tried a different approach with a Script/Run Shell task with "running as root" checked, and a call to the "am" command (which could be in a shell script):

 am start -a jackpal.androidterm.RUN_SCRIPT -e jackpal.androidterm.iInitialCommand 'exec su -c whoami'

This launches Terminal Emulator with "whoami" running as root (replace whoami by something more useful as needed :))

BTW my goal behind this is to call interactive shell commands from tasker (that's why I needed a terminal)
Reply all
Reply to author
Forward
0 new messages