安装jdk
安装安卓sdk(打开sdk的时候出现问题)
安装gradle,配置环境变量()
*安装node,并且配置环境变量
下载后解压到文件,
配置环境变量:
此外还要设置一下路径:
npm config set prefix /usr/local/lib/node_modules/node_global
npm config set cache /usr/local/lib/node_modules/node_cache下载macaca-cli
复制macaca-android到 macaca-cli的同级目录下!
python2.7——3.5升级,pip 安装
手机连接设备无法认证( http://www.mamicode.com/info-detail-1418256.html )
http://blog.csdn.net/u013952558/article/details/44199505
===============================================================
启动服务,然后再运行!
import unittestimport timefrom macaca import WebDriverdesired_caps = { 'platformName': 'Android', # iOS, Android, Desktop #'browserName': 'Chrome', # Chrome, Electron "package": "com.tencent.mm", "activity": "com.tencent.mm.ui.LauncherUI", "deviceName":"91QEBNQ2RNFG"}server_url = { 'hostname': '192.168.213.128', 'port': 3457}class MacacaTest(unittest.TestCase): def setUp(self): self.driver = WebDriver(desired_caps, server_url) self.driver.init() def tearDown(self): self.driver.quit() def test_macaca(self): time.sleep(5) el=self.driver.element_by_name("直播") el.click() time.sleep(2)if __name__ == '__main__': unittest.main()
先简要记录,完毕再整理