美文网首页
appium start session 时报错 Origin

appium start session 时报错 Origin

作者: 酥酒 | 来源:发表于2023-02-06 17:11 被阅读0次

    配置信息:
    {
    "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

    相关文章

      网友评论

          本文标题:appium start session 时报错 Origin

          本文链接:https://www.haomeiwen.com/subject/pymtkdtx.html