0

my AndroidManifest.xml file have

<intent-filter>...</intent-filter>

But when I write down adb shell am start -n com.xxx.applicationname/.MainActivity

it logs

Error type:3

Error: Activity class does not exist

Edit my gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.xxx.applicationname"
        minSdkVersion 9
        targetSdkVersion 17
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.1.1'
}

1 Answers1

0

Check the application's path to call the activiy in your android manifest file. For example,when you open your application by touching your phone screen, then in the logcat there would be a hint like this. enter image description here

Then find the details in the android manifest file enter image description here

in this example, the link is the name of activity "android:name=Setting$WifiDisplaySettingsActivity"

So the command for this case is:

adb shell am start -n 'com.android.settings/.Settings\$WifiDisplaySettingsActivity'

NOTE: the apostrophe marks ' ' and the backSlash \ are very important. You SHOULD NOT miss it.

tngotran
  • 361
  • 2
  • 7