在使用 python+appium 自动安装 apk 安装包时已经安装成功,但提示不能开始程序
下面是我的代码:
from appium import webdriver
import os

# 提取安装包根路径
apk_path = os.path.abspath(os.path.join(os.path.dirname(os.path.realpath(file)),'..'))
appPath = lambda x:os.path.join(apk_path,'x7sy\app',x)

caps = {}
caps["platformName"] = "Android"
caps["platformVersion"] = "5.1.1"
caps["deviceName"] = "127.0.0.1:5555"
caps["app"] = appPath('安装包')
caps["appPackage"] = "包名"
caps["appActivity"] = "包名.activity.MainActivit"
driver = webdriver.Remote("http://127.0.0.1:4723/wd/hub", caps)

下面是运行代码后的报错:
selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Cannot start the '包名' 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 '包名' application. Visit https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/activity-startup.md for troubleshooting. Original error: Activity name '.包名.activity.MainActivit' used to start the app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity

请教下这是什么情况


↙↙↙阅读原文可查看相关链接,并与作者交流