Launching Terminal Emulator for Android from another App

jackpal edited this page Sep 25, 2014 · 1 revision

Terminal Emulator for Android can be launched programmatically from another Android application using the standard Android Intent mechanism. You can optionally supply an intent extra to specify an initial command to be passed to the terminal emulator.


  • jackpal.androidterm.OPEN_NEW_WINDOW opens a new terminal window. No script execution is allowed, and no permissions are required to use this action.
  • jackpal.androidterm.RUN_SCRIPT opens a new window and runs the script specified in the jackpal.androidterm.iInitialCommand extra. Applications using this intent must have the jackpal.androidterm.permission.RUN_SCRIPT permission, which must be approved by the user at install time.


// opens a new window
Intent i = new Intent("jackpal.androidterm.OPEN_NEW_WINDOW");

// opens a new window and runs "echo 'Hi there!'"
// application must declare jackpal.androidterm.permission.RUN_SCRIPT in manifest
Intent i = new Intent("jackpal.androidterm.RUN_SCRIPT");
i.putExtra("jackpal.androidterm.iInitialCommand", "echo 'Hi there!'");

Sample code:

There's an example application showing how to use these intents here:

CTE Intent Sample Application