title: cannot get this adb shell am start line to work
body: <p>I am trying to launch this app on my emulator.. Here is my adb shell am start line</p>
  
  <pre><code>C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;adb shell am start -n com.example.harvey.Sunshinea1app/com.example.harvey.Sunshinea1app.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { cmp=com.example.harvey.Sunshinea1app/.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.Sunshinea1app/com.example.harvey.Sunshinea1app.MainActivity} does not exist.
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;
  </code></pre>
  
  <p>I know the warning isn't such an issue but the MainActivity does not exist part of that message is pointing to an issue that is stopping the command from being able to start the program.</p>
  
  <p>I know I have something wrong in regarding the path or the name but I can't see what. I guess i'm a bit confused by what is what.   No doubt i've written the path wrong somewhere but I don't know where.</p>
  
  <p>Here is a dir Sunshine* /s/b  </p>
  
  <p>I guess it might give some info that may help to determine what that adb line should be. If you need any other info please comment letting me know.</p>
  
  <pre><code>C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;dir Sunshine*.* /s/b
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\Sunshinea1.iml
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\buildConfig\debug\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\buildConfig\debug\com\example\harvey\sunshinea1app\sunshinea1
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\buildConfig\test\debug\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\buildConfig\test\debug\com\example\harvey\sunshinea1app\sunshinea1
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\r\debug\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\generated\source\r\debug\com\example\harvey\sunshinea1app\sunshinea1
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\intermediates\classes\debug\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\intermediates\classes\debug\com\example\harvey\sunshinea1app\sunshinea1
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\src\androidTest\java\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\src\androidTest\java\com\example\harvey\sunshinea1app\sunshinea1
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\src\main\java\com\example\harvey\sunshinea1app
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\src\main\java\com\example\harvey\sunshinea1app\sunshinea1
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;
  </code></pre>
  
  <p><strong>EDIT</strong>
  was getting this error</p>
  
  <pre><code>C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;adb shell monkey -p com.example.harvey.Sunshinea1app -c android.intent.category.LAUNCHER 1
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  ** No activities found to run, monkey aborted.
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;
  </code></pre>
  
  <p>Looking at carlo's answer, i've decided to include my package name in the question, this from MainActivity.java</p>
  
  <p>As for my package name</p>
  
  <pre><code>C:\&gt;type C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\src\main\java\com\exampl
  e\harvey\sunshinea1app\sunshinea1\MainActivity.java | grep package
  
  package com.example.harvey.sunshinea1app.sunshinea1;
  
  C:\&gt;
  </code></pre>
  
  <p>So now i've revised the package line in the adb shell monkey line</p>
  
  <pre><code>C:\&gt;adb shell monkey -p com.example.harvey.sunshinea1app.sunshinea1 -c android.intent.
  category.LAUNCHER 1
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a secur
  ity risk. Please fix.
  Events injected: 1
  ## Network stats: elapsed time=85ms (0ms mobile, 0ms wifi, 85ms not connected)
  </code></pre>
  
  <p>the adb shell monkey line does work now..</p>
  
  <pre><code>C:\&gt;adb devices
  List of devices attached
  emulator-5554   device
  
  
  C:\&gt;
  </code></pre>
  
  <p>But the adb shell am line isn't </p>
  
  <pre><code>C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;dir MainActivity.class /s/b
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\intermediates\classes\debug\com\example\harvey\sunshinea1app\sunshinea1\MainActivity.class
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;
  </code></pre>
  
  <p>attempts at adb shell am start</p>
  
  <pre><code>C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;adb shell am start -n com.example.harvey.sunshinea1app/com.example.harvey.sunshinea1app.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { cmp=com.example.harvey.sunshinea1app/.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.sunshinea1app/com.example.harvey.sunshinea1a
  pp.MainActivity} does not exist.
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;adb shell am start -n com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1app/.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { cmp=com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1
  app/.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1
  app/.MainActivity} does not exist.
  
  C:\Users\harvey\AndroidStudioProjects\Sunshinea1&gt;
  </code></pre>
  
  <p>I checked this QnA</p>
  
  <p><a href="https://stackoverflow.com/questions/20230285/error-activity-class-does-not-exist-when-launching-android-app-with-adb-shell">error &quot;activity class does not exist&quot; when launching android app with adb shell am start</a></p>
  
  <p>which had the idea of checking logcat
  then doing adb shell am  and then -a(for what follows act=) -c(for what follows cat=) and -n(for what follows cmp=) based on the output.. </p>
  
  <pre><code>02-09 18:04:05.763    1277-1288/? I/ActivityManager﹕ START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10000000 cmp=com.example.harvey.sunshinea1app.sunshinea1/.MainActivity} from pid 1781
  </code></pre>
  
  <p>But it doesn't work</p>
  
  <p>dir MainActivity.class /s/b
  shows MainActivity.class is stored here    </p>
  
  <p>C:\Users\harvey\AndroidStudioProjects\Sunshinea1\app\build\intermediates\classes\debug\com\example\harvey\sunshinea1app\sunshinea1\MainActivity.class</p>
  
  <p>I run the adb shell am start command, with -a -c and -n, but it doesn't find the class</p>
  
  <pre><code>C:\&gt;adb shell am start -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.example.harvey.sunshinea1app.sunshinea1/.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.example.harvey.sunshinea1app.sunshinea1/.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.sunshinea1app.sunshinea1/com.example.harvey.
  sunshinea1app.sunshinea1.MainActivity} does not exist.
  
  C:\&gt;
  </code></pre>
  
  <p>trying the suggestion in a comment</p>
  
  <pre><code>C:\&gt;adb shell am start -n com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1app.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { cmp=com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1
  app.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.sunshinea1app/com.example.harvey/.sunshinea1app.MainActivity} does not exist.
  
  C:\&gt;
  </code></pre>
  
  <p>a better attempt as suggested in the comment, but still fails</p>
  
  <pre><code>C:\&gt;adb shell am start -n com.example.harvey.sunshinea1app/.sunshinea1.MainActivity
  WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix.
  Starting: Intent { cmp=com.example.harvey.sunshinea1app/.sunshinea1.MainActivity }
  Error type 3
  Error: Activity class {com.example.harvey.sunshinea1app/com.example.harvey.sunshinea1app.sunshinea1.MainActivity} does not exist.
  
  C:\&gt;
  </code></pre>
  
  <p>Here is a pic from devtools package manager for the sunshinea1 app that I am trying to do adb shell am start on.</p>
  
  <p><img src="https://i.stack.imgur.com/Cuawz.png" alt="enter image description here"></p>