李明
|
docker run --privileged -d -p 4723:4723 --name appium1 appium/appium
adb devices
adb -s 127.0.0.1:62001 tcpip 55555
2.查看模拟器的ip地址
ping 192.168.1.120 docker exec -it appium1 adb connect 192.168.1.120:55555 docker exec -it appium1 adb devices
4.测试python,运行docker appium,运行模拟器
docker ps -a docker logs -f appium1
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 2019/3/12 15:11 # @Author : Aries # @Site : # @File : aaa.py # @Software: PyCharm from appium import webdriver cap = { "platformName": "Android", "platformVersion": "4.4.2", "deviceName": "192.168.1.120:55555", "udid":"192.168.1.120:55555", # 真机的 # "platformName": "Android", # "platformVersion": "7.1.2", # "deviceName": "10d4e4387d74", "appPackage": "com.ss.android.ugc.aweme", "appActivity": "com.ss.android.ugc.aweme.main.MainActivity", "noReset": True, "unicodeKeyboard": True, "resetkeyboard": True } driver = webdriver.Remote("http://192.168.70.100:4723/wd/hub", cap)
PS:通过docker appium的方式运行远程的虚拟机,真机也是一样啊,先通过adb devices,找到后,然后改成tcpip的形式,让docker appium连接 设备,代码设置里面区别,基本就是这样。
|
2019-07-05 17:57:24