今天换个app,启动session时,竟然报错了,之前的app都能正常启动的,报错如下:(报错中的***是app命令 做了打码处理)
An unknown server-side error occurred while processing the command. Original error: Cannot start the 'com.*****.*****' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Error executing adbExec.
Original error: 'Command 'D:\\Test_Tools\\auto_test\\app\\adt-bundle-windows-x86-20130917\\sdk\\platform-tools\\adb.exe -P 5037 -s 3520541a shell am start -W -n com.*****.*****/com.*****.******.ui.activity.MainActivity -S' exited with code 1';
Stderr: 'java.lang.SecurityException: Permission Denial: starting Intent { flg=0x10000000 cmp=com.*****.*****/.ui.activity.MainActivity } from null (pid=13486, uid=2000) not exported from uid 10552
解决办法是 原来是appActivity 写错了,启动不了app。后来换了一下appActivity,session启动成功了。
二、同时 如何启动appActivity 可以用这个命令,绝对好用:
首先打开要测试的App,然后在cmd里运行 adb shell dumpsys window windows
cmd里最后一行 就是我们要的appActivity, .ui.activity.SplashActivity 如图: