I am issuing following command to Nexus 7 tablet:
adb.exe -s 015d2109567231a0f shell am startservice -n com.packagename/.ExServiceName --ei port 59777
and getting:
Starting service: Intent { cmp=com.packagename/.ExServiceName (has extras) }
java.lang.SecurityException: Caller uid=2000 is not privileged to communicate with user=-2
at android.os.Parcel.readException(Parcel.java:1425)
at android.os.Parcel.readException(Parcel.java:1379)
at android.app.ActivityManagerProxy.startService(ActivityManagerNative.java:2648)
at com.android.commands.am.Am.runStartService(Am.java:415)
at com.android.commands.am.Am.run(Am.java:111)
at com.android.commands.am.Am.main(Am.java:82)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:235)
at dalvik.system.NativeStart.main(Native Method)
Current tablet information:
Model number: Nexus 7
Android version: 4.2
Kernel version: 3.1.10-g22b4fcd
Service manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.packagename"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="15" />
<uses-permission android:name="android.permission.INTERNET"/>
<application android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:theme="@style/AppTheme">
<service android:name=".ExServiceName" android:exported="true"></service>
</application>
</manifest>
I am developing under Windows 7 x64
Can you please tell me how to make the service successfully accept the intent without throwing exceptions of any kind?
Thanks,
Konrad
I got the same exception on a Galaxy Nexus which version is Android 4.2.
I succeeded to start a service by the following command.
am startservice --user 0 -a <action>
After a lot of searching on the internet and Koji Hisano's very helpful post, I managed to get the System Bar to appear using:
am startservice --user 0 -n com.android.systemui/.SystemUIService
If the -a option was used I was getting a message:
Error: Not found; no service started.
You might start the service on a rooted phone also with:
adb.exe -s 015d2109567231a0f shell su -c "am startservice -n com.packagename/.ExServiceName --ei port 59777"
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