Appium启动报错

关键字:activiy获取 topActiviy 获取、Appium启动

Appium 启动报错,

很有可能是你找到的Activity并不正确,导致启动时无法启动。

Failed to create session. 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: Activity name '.cms.presentation.w1elcome.presentation.WelcomeActivity' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
image.png
image.png

可以尝试使用

adb shell dumpsys activity | grep realActivity
    realActivity={com.tencent.androidqqmail/com.tencent.qqmail.launcher.desktop.LauncherActivity}
image.png

获取Activiy的方式总结

# windows端:
adb shell dumpsys window windows | findstr mFocusedApp
# mac端:  
adb shell dumpsys window windows | grep mFocusedApp

# 其它方法1
adb shell dumpsys window | grep mFocusedApp

# 其它方法2
adb shell dumpsys activity | grep realActivity

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

推荐阅读更多精彩内容