Appium启动app报错:[debug] [MJSONWP] java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.dssj.didi/.main.login.LoginActivity } from null (pid=7790, uid=2000) not exported from uid 10078

appium-server-logs.txt (22.1 KB)
1、同样的caps参数,在mac本地的mumu模拟器启动app成功
2、同样的caps参数,在windows服务器,使用image 启动app失败,已兼容arm,app手动可以启动
问题截图:
An unknown server-side error occurred while processing the command. Original error: Cannot start the ‘com.dssj.didi’ application. Visit appium/activity-startup.md at master · appium/appium · GitHub for troubleshooting. Original error: Error executing adbExec. Original error: ‘Command ‘D:\Android\sdk\platform-tools\adb.exe -P 5037 -s 127.0.0.1:5555 shell am start -W -n com.dssj.didi/.main.login.LoginActivity -S’ exited with code 255’; Stderr: ‘Security exception: Permission Denial: starting Intent { flg=0x10000000 cmp=com.dssj.didi/.main.login.LoginActivity } from null (pid=7525, uid=2000) not exported from uid 10078 java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.dssj.didi/.main.login.LoginActivity } from null (pid=7525, uid=2000) not exported from uid 10078 at com.android.server.am.ActivityStackSupervisor.checkStartAnyActivityPermission(ActivityStackSupervisor.java:1781) at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:720) at com.android.server.am.ActivityStarter.startActivity(ActivityStarter.java:547) at com.android.server.am.ActivityStarter.startActivityMayWait(ActivityStarter.java:1107) at com.android.server.am.ActivityStarter.execute(ActivityStarter.java:488) at com.android.server.am.ActivityManagerService.startActivityAndWait(ActivityManagerService.java:5244) at com.android.server.am.ActivityManagerShellCommand.runStartActivity(ActivityManagerShellCommand.java:474) at com.android.server.am.ActivityManagerShellCommand.onCommand(ActivityManagerShellCommand.java:161) at android.os.ShellCommand.exec(ShellCommand.java:103) at com.android.server.am.ActivityManagerService.onShellCommand(ActivityManagerService.java:16042) at android.os.Binder.shellCommand(Binder.java:634) at android.os.Binder.onTransact(Binder.java:532) at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3592) at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:3288) at android.os.Binder.execTransact(Binder.java:731)’; Code: ‘255’

原因:appActivity不对,不是默认启动页,通过adb logcat |grep -i displayed和 adb shell dumpsys window|grep mCurrent 未抓取到app的默认启动页面,咨询开发得到了正确的默认启动页,解决了问题。开发建议使用反编译工具或者使用sdk的monitor.bat工具查看。

1 Like

论坛上这类的报错不少,看来讲课的时候得重点提醒下。

关闭