You need to add android:exported="true"
to start service from ADB command line. Then your manifest looks something like this:
<!-- Service declared in manifest -->
<service
android:name=".YourServiceName"
android:exported="true"
android:launchMode="singleTop">
<intent-filter>
<action android:name="com.your.package.name.YourServiceName"/>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</service> <!-- Note: Service is exported to start it using ADB command -->
And then from ADB
To start service:
adb shell am startservice com.your.package.name/.YourServiceName
To stop service (on Marshmallow):
adb shell am stopservice com.your.package.name/.YourServiceName
To stop service (on Jelly Bean):
adb shell am force-stop com.your.package.name