Start an Android application via a shell script? Is it possible to start an actual Android application from the command line in Android? For example, say I'd simply like to start/bring to the front my calendar. Is there a way that I can do this like:

startapp com.google.calendar
Using adb, I believe it is possible:

am [start|instrument]
am start [-a &lt;action&gt;] [-d &lt;data_uri&gt;] [-t &lt;mime_type&gt;]
[-c &lt;category&gt; [-c &lt;category&gt;] ...]
[-e &lt;extra_key&gt; &lt;extra_value&gt; [-e &lt;extra_key&gt; &lt;extra_value&gt; ...]
[-n &lt;component&gt;] [-D] [&lt;uri&gt;]
am instrument [-e &lt;arg_name&gt; &lt;arg_value&gt;] [-p &lt;prof_file&gt;]
[-w] &lt;component&gt;


for example we have android program with Manifest as under:

&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
 package="com.app1.android.xtract"&gt;
  &lt;application android:icon="@drawable/icon"&gt;
   &lt;activity class=".Contact" android:label="@string/app_name"&gt;
    &lt;intent-filter&gt;
    &lt;action android:value="android.intent.action.MAIN" /&gt;
    &lt;category android:value="android.intent.category.LAUNCHER" /&gt;
   &lt;/intent-filter&gt;
  &lt;/activity&gt;
 &lt;/application&gt;
.
.
&lt;/manifest&gt;


To run the code issue command like this (in one line):

am start -a android.intent.action.MAIN -n com.app1.android.xtract/com.app1.android.xtract.Contact