# -*- coding: utf-8 -*-
from appium import webdriver
def init_connect():
PLATFORM = 'Android'
PLATFORMVERSION = '8.0.0'
DEVICENAME = 'V9D4C184190029xxx'
APP_PACKAGE = 'com.xxxx.appmarket'
APP_ACTIVITY = '.MainActivity'
AUTOMATIONNAME = 'Appium'
DRIVER_SERVER = 'http://127.0.0.1:4723/wd/hub'
#参数池
desired_caps = {}
desired_caps['platformName'] = PLATFORM
desired_caps['platformVersion'] = PLATFORMVERSION
desired_caps['deviceName'] = DEVICENAME
desired_caps['appPackage'] = APP_PACKAGE
desired_caps['appActivity'] = APP_ACTIVITY
desired_caps['sessionOverride'] = True
desired_caps['automationName'] = AUTOMATIONNAME
desired_caps['appWaitActivity'] = APP_ACTIVITY
desired_caps['sessionOverride'] = True
desired_caps['unicodeKeyboard'] = True
desired_caps['resetKeyboard'] = True
driver = webdriver.Remote(DRIVER_SERVER, desired_caps)
return driver
#测试链接
if __name__ == '__main__':
driver = init_connect()