appium 1.6.3 + ios 10.2 + xcode 8.2.1 真机运行iphone app

Posted testway

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了appium 1.6.3 + ios 10.2 + xcode 8.2.1 真机运行iphone app相关的知识,希望对你有一定的参考价值。

appium命令行启动:

appium --address "127.0.0.1" --session-override --pre-launch --debug-log-spacing --log "/tmp/appium.log" --platform-version "10.2" --platform-name "ios" --app "com.abc.abcdef" --udid "f9b87274e2a24b310399dd56dd80f8561d99fdac" --show-ios-log --device-name "iPhone 6s Plus"

 

testng用例代码:

        IOSDriver<MobileElement> driver = null;
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.2");
        capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6s Plus");
        capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
        capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
        capabilities.setCapability(MobileCapabilityType.APP, "/Users/apptest/Downloads/abcdef.ipa");
        capabilities.setCapability(MobileCapabilityType.UDID, "f9b87274e2a24b310399dd56dd80f8561d99fdac");
        // capabilities.setCapability(MobileCapabilityType.,"f9b87274e2a24b310399dd56dd80f8561d99fdac");
        try {
            driver = new IOSDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
        } catch (MalformedURLException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

            driver.findElementByName("个人中心").click();
            driver.findElementByName("首页").click();
    

 

以上是关于appium 1.6.3 + ios 10.2 + xcode 8.2.1 真机运行iphone app的主要内容,如果未能解决你的问题,请参考以下文章

转2Appium 1.6.3 在Xcode 8 (真机)测试环境搭建 经验总结

Installation Guide for Appium 1.6.3

appium 1.6 使用与APP-inspector定位

xcode构建webdriverAgent时报错Messaging unqualified id的解决办法

CLLocationManager 未在 iOS 10.2 [Swift] 中调用 didUpdateLocation()

本地通知在 iOS 10.2 中没有出现在前台