为什么我在从adb shell拨打电话时看到错误?

时间:2009-09-08 18:44:13

标签: android adb android-securityexception

这曾经有用:

adb shell am start -a android.intent.action.CALL tel:1234

但是,现在我收到了这个错误:

09-08 14:35:57.821 W/dalvikvm( 1107): threadid=3: thread exiting with uncaught exception (group=0x4001b200)
09-08 14:35:57.841 E/AndroidRuntime( 1107): Uncaught handler: thread main exiting due to uncaught exception
09-08 14:35:57.841 E/AndroidRuntime( 1107): *** EXCEPTION IN SYSTEM PROCESS.  System will crash.
09-08 14:35:57.871 E/AndroidRuntime( 1107): java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.CALL dat=tel:1234 flg=0x10000000 cmp=com.android.phone/.OutgoingCallBroadcaster } from null (pid=-1, uid=-1) requires android.permission.CALL_PHONE
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.os.Parcel.readException(Parcel.java:1218)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.os.Parcel.readException(Parcel.java:1206)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at android.app.ActivityManagerProxy.startActivity(ActivityManagerNative.java:1149)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.runStart(Am.java:202)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.run(Am.java:76)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.commands.am.Am.main(Am.java:54)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.internal.os.RuntimeInit.finishInit(Native Method)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:186)
09-08 14:35:57.871 E/AndroidRuntime( 1107):     at dalvik.system.NativeStart.main(Native Method)
09-08 14:35:57.911 E/JavaBinder( 1107): Unknown binder error code. 0xfffffff7
09-08 14:35:57.921 E/AndroidRuntime( 1107): Crash logging skipped, no checkin service
09-08 14:35:57.921 I/Process ( 1107): Sending signal. PID: 1107 SIG: 9

有解决方法吗?

2 个答案:

答案 0 :(得分:1)

这似乎是对的 - 我不知道为什么它之前有效,但Android正在运作它应该如何 - adb shell没有调用权限(android.permission.CALL_PHONE)。您可以通过将am作为root运行来解决此问题(如果您在手机上拥有root权限):只需在执行命令之前执行su

答案 1 :(得分:1)

我终于能够使用adb服务命令(http://davanum.wordpress.com/2007/12/12/android-calldial-from-the-adb-shell-command-line/

完成我想要的工作