电脑 Eclipse 中运行测试代码时,三星 Galaxy S7、酷派 S6 均无法启动 Acitivity,提示 “error: Permission to start activity denied”
查看 Appium 中报错处代码
executing cmd: D:\WorkTool\Appium\android-sdk-windows\platform-tools\adb.exe -s 89f56ba0 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.changhong.mscreensynergy.chiq3/com.changhong.mscreensynergy.ui.MainActivity"
error: Permission to start activity denied.
将该段代码拷贝到 adb 中执行
adb -s 89f56ba0 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.changhong.mscreensynergy.chiq3/com.changhong.mscreensynergy.ui.MainActivity"
提示安全异常
java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.changhong.mscreensynergy.chiq3/com.changhong.mscreensynergy.ui.MainActivity VirtualScreenParam=Params{mDisplayId=-1, null, mFlags=0x00000000)} } from null (pid=8820, uid=2000) not exported from uid 10379
将手机换为 root 后的开发版小米 3,应用可以成功打开 MainActivity