如何使用 Appium-Python 启动 Android 应用程序活动?

问题描述 投票:0回答:1

我想启动一个具有特定活动的 Android 应用程序。 Appium 有一个

'start_activity'
函数,但已弃用。相反,它建议使用
'mobile: startActivity'
扩展,但我不明白如何操作。我是编码新手,非常感谢任何帮助。

谷歌搜索和 Appium 文档阅读没有帮助。

python android appium
1个回答
0
投票

根据这个github问题,你可以使用这样的东西:

driver = webdriver.Remote(appium_server_url, options=UiAutomator2Options().load_capabilities(capabilities))
driver.execute_script('mobile: startActivity',{'component': f'com.xiaomi.smarthome/.SmartHomeMainActivity',})
© www.soinside.com 2019 - 2024. All rights reserved.