DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(CapabilityType.BROWSER_NAME, "");
cap.setCapability("platformName","Android");
//设备名称
cap.setCapability("deviceName","G6P7BIQCFA79GAS4");
//ָ系统版本号
cap.setCapability("platformVersion","4.4.4");
//安装app的路径
//cap.setCapability("app", "D:\\Users\\fengunion\\eclipse-workspace\\Appium_demo\\apps\\app-company-sit_V1.10_201801301750.apk");
//app的包名ֵ
cap.setCapability("appPackage", "com.*");
//启动的activity
cap.setCapability("appActivity", "com.*.SplashActivity");
driver = new AndroidDriver(new URL("http://127.0.0.1:4723/wd/hub"), cap);
deviceName:启动哪种设备,是真机还是模拟器?iPhone Simulator,iPad Simulator,iPhone Retina 4-inch,Android Emulator,Galaxy S4…
automationName:使用哪种自动化引擎。appium(默认)还是Selendroid。
platformName:使用哪种移动平台。iOS, Android, orFirefoxOS。
platformVersion:指定平台的系统版本。例如指的Android平台,版本为5.1。
appActivity:待测试的app的Activity名字。比如MainActivity、.Settings。注意,原生app的话要在activity前加个”.“。
appPackage:待测试的app的Java package。比如com.example.android.myApp, com.android.settings。