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!
adb shell am startservice -n com.mypackage/.service.MyService
Update (Per adb shell am help start-service
):
-n
<COMPONENT_NAME>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With