# 安卓

adb 命令获取到 activity 启动时间

def getStartupTimeByAndroid(self, activity, deviceId):
    result = adb.shell(cmd='am start -W {}'.format(activity), deviceId=deviceId)
    return result

# IOS

基于 pydevice 获取

def getStartupTimeByiOS(self, pkgname):
    try:
        import ios_device
    except ImportError:
        logger.error('py-ios-devices not found, please run [pip install py-ios-devices]') 
    result = self.execCmd('pyidevice instruments app_lifecycle -b {}'.format(pkgname))       
    return result