appium start session 时报错 Original error: Error executing adbExec.

配置信息:
{
"platformName": "Android",
"deviceName": "13b20111",//我用真机调试,adb devices获取
"platformVersion": "13.0",
"appPackage": "com.xxx.test",//包名
"appActivity": "com.xxx.ui.MainActivity",//用adb shell dumpsys activity top | find "ACTIVITY"获取
"automationName": "uiautomator2"//我用的是appium2.0,用1.x版本此处写uiautomator1
}

启动的时候报错了:
Encountered internal error running command: Error: Cannot start the ‘com.android.settings’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Cannot start the ‘com.android.settings’ application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name ‘.com.android.settings.ConfirmLockPattern$InternalActivity’ used to start the app doesn’t exist or cannot be launched! Make sure it exists and is a launchable activity

原因:appActivity错了,配置中需要填写的是launcher activity
获取方法:
用数据线连接手机,打开开发者模式,并赋予相关权限;
1、清除日志:

adb logcat -c

2、启动日志:

adb logcat ActivityManager:I *:s

3、点击启动手机App:


image.png

参考:
作者:此生不换Yang
获取App的PackageName包名和LauncherActivity启动页
链接:https://www.cnblogs.com/yjlch1016/p/8511946.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容