Cannot launch activity from adb

android

Solution

try using: `adb shell "am start -n com.example.com.testapp/.TestActivity -a com.testapp.action.TEST_ACTION"`

or

`adb shell "am start com.example.com.testapp -a com.testapp.action.TEST_ACTION"`

hope that works.

Problem

I have the following in my AndroidManifest.xml (I just added a second activity to the default project): ``` <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name="com.example.com.testapp.MainActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name="com.example.com.testapp.TestActivity" android:label="@string/title_activity_test" > <intent-filter> <action android:name="com.testapp.action.TEST_ACTION" /> </intent-filter> </activity> ``` I want to launch the TestActivity using adb command. I tried: ``` ./adb shell am start -a com.testapp.action.TEST_ACTION ``` But it gives the error: ``` Error: Activity not started, unable to resolve Intent { act=com.testapp.action.TEST_ACTION flg=0x10000000 } ``` Can someone please explain why I am getting this error and how to resolve it? Edit : Can anyone tell a way to just use action to launch the 'TestActivity'.

Original source

Related problems