编程语言
首页 > 编程语言> > Appium+python启动虚拟机app

Appium+python启动虚拟机app

作者:互联网

查看appPackage和appActivity方法:

1.先在cmd命令行输入  adb logcat ActivityManager:I *:s

2.点击虚拟机启动app即可查看,/前是appPackage,/后是appActivity

其他方法见:https://blog.csdn.net/xl_lx/article/details/78717917

代码:

# -*- coding:UTF-8 -*-
from appium import webdriver
import time
#import unittest
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['platformVersion'] = '6.0'
desired_caps['appPackage'] = 'com.netease.cloudmusic'
desired_caps['appActivity'] = '.activity.LoadingActivity'
wd = webdriver.Remote("http://127.0.0.1:4723/wd/hub", desired_caps)

time.sleep(30);	#睡眠30S等APP启动完成

 

标签:appActivity,python,虚拟机,caps,desired,appPackage,import,app
来源: https://www.cnblogs.com/graybird/p/11305211.html