Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android adb shell am startservice: Error not found

Tags:

android

adb

I am trying to start the service from adb shell. There already is similar question: How to start and stop android service from a adb shell? However, when I start service with:

adb shell am startservice com.mypackage/com.mypackage.service.MyService

I receive this message:

Starting service: Intent { act=android.intent.action.VIEW dat=com.mypackage/com.mypackage.service.MyService }
Error: Not found; no service started.

I declare service in AndroidManifest.xml:

<application>
  ...
  <service
    android:name="com.mypackage.service.MyService"
    android:label="@string/local_service_label"
    android:icon="@drawable/ic_launcher">
  </service>
</application>

Do you have any idea how to solve this? Thank you!

like image 852
stevo.mit Avatar asked Sep 10 '12 07:09

stevo.mit


1 Answers

adb shell am startservice -n com.mypackage/.service.MyService

Update (Per adb shell am help start-service):

-n <COMPONENT_NAME>

like image 80
Jaybo Avatar answered Sep 25 '22 07:09

Jaybo