You cannot install and run at a time - but you can use adb to run an already installed application. Use the adb shell to start intentional intent - you will need to use the correct intent for your application. A few examples:
adb shell am start -a android.intent.action.MAIN -n com.android.settings/.Settings
Settings will start and
adb shell am start -a android.intent.action.MAIN -n com.android.browser/.BrowserActivity
will launch the browser. If you want to specify a browser on a specific page, do it
adb shell am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://www.google.co.uk
If you don’t know the name of the activity in the APK, do it
aapt d xmltree <path to apk> AndroidManifest.xml
output content will contain the following section:
E: activity (line=32) A: android:theme(0x01010000)=@0x7f080000 A: android:label(0x01010001)=@0x7f070000 A: android:name(0x01010003)="com.anonymous.MainWindow" A: android:launchMode(0x0101001d)=(type 0x10)0x3 A: android:screenOrientation(0x0101001e)=(type 0x10)0x1 A: android:configChanges(0x0101001f)=(type 0x11)0x80 E: intent-filter (line=33) E: action (line=34) A: android:name(0x01010003)="android.intent.action.MAIN" XE: (line=34)
This tells you the name of the main action (MainWindow), and now you can run
adb shell am start -a android.intent.action.MAIN -n com.anonymous/.MainWindow
Airsource Ltd May 24 '11 at 10:53 2011-05-24 10:53
source share