wait_activity(self, activity, timeout, interval=1):
    
    android特有的

    返回的True 或 False

    :Agrs:

     - activity - 需等待的目标 activity

     - timeout - 最大超时时间,单位是s

     - interval - 循环查询时间

    用法:driver.wait_activity(‘.activity.xxx’,5,2)

代码操作

#coding= utf-8
from appium import webdriver
desired_caps = {
'platformName':"Android",
'deviceName':"R8V5T15930002010",
'platformVersion':"5.0.1",
'appPackage':"com.yuedan",
'appActivity':"com.yuedan.ui.Activity_Splash",
'unicodeKeyboard': True,#使用unicode编码方式发布字符串
'resetKeyboard': True #屏蔽软键盘

}
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
# 等主页面activity出现,30秒内
ac = driver.current_activity
print(ac)
driver.wait_activity(".ui.Activity_Splash", 30)

# 登录
driver.find_element_by_id("com.yuedan:id/login").click()