启动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" --safari --browser-name "Safari" --udid "f9b87274e2a24b310399dd56dd80f8561d99fdac" --show-ios-log --device-name "iPhone 6s Plus"

        DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "safari");
capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.2");
capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "iPhone 6s Plus");
capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
capabilities.setCapability(MobileCapabilityType.UDID,"f9b87274e2a24b310399dd56dd80f8561d99fdac");
driver = new IOSDriver<MobileElement>(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);

遇到问题:


[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...

[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...

[debug] [XCUITest] Waiting for WebDriverAgent server to finish loading...

参考:https://github.com/appium/appium/issues/6892

解决办法:

安装最新版本的appium + appium-xcuitest-driver@2.5.3

cd /usr/local/lib/node_modules/appium
npm uninstall appium-xcuitest-driver
npm install appium-xcuitest-driver@2.5.3


cd  /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent


mkdir -p Resources/WebDriverAgent.bundle


sh ./Scripts/bootstrap.sh -d



安装后,还需要编译appium-xcuitest-driver  打开项目文件使用命令:


open /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj/

编译方法
参考:http://www.cnblogs.com/testway/p/6298126.html执行如下命令,会在手机上安装一个 WebDriver 程序


xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=f9b87274e2a24b310399dd56dd80f8561d99fdac' test

执行这些步骤后,可以打开iphone的safari浏览器,但是默认打开的网页地址为appium.io 同时appium日志提示:

2017-01-19 12:13:03:750 - warn: [iOS] Attempted to get a list of webview contexts but could not connect to ios-webkit-debug-proxy. If you expect to find webviews, please ensure that the proxy is running and accessible

2017-01-19 12:13:03:750 - info: [debug] [iOS] No web frames found.

2017-01-19 12:13:03:750 - warn: [iOS] Could not find any webviews yet, refreshing/retrying

2017-01-19 12:13:03:792 - info: [iOSLog] [IOS_SYSLOG_ROW] Jan 19 20:12:51 iPhone locationd[63] <Notice>: message 'kCLConnectionMessageWatchdog' received from client '/System/Library/LocationBundles/WifiCalling.bundle'

 

appium 1.6.3 + ios 10.2 + xcode 8.2.1 真机运行safari的更多相关文章

  1. 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-spac ...

  2. 如何使用Xcode分析调试在真机运行的UE4 IOS版游戏

    写本文的是因为UE4 官方文档虽然也有,但主要讲的是是用UE4Editor把游戏打成一个IPA包的形式发布的方法 而对于想通过Xcode分析UE4的渲染流程来学习或优化的朋友,那官方文档的资料还是不够 ...

  3. 如何在 iOS 真机运行 Appium

    使用 gui 启动的 appium 1.2.2 也会有这个问题,所以你要把 deviceconsole 复制到 /Applications/Appium.app/Contents/Resources/ ...

  4. 使用Xcode 7 beta免费真机调试iOS应用程序

    使用Xcode 7 beta免费真机调试iOS应用程序 六月 9, 2015  |   K-Res 发布   今天凌晨的WWDC15虽然没有熬夜守候吧,但也还是早起第一时间翻看了twitter的相关标 ...

  5. Xcode 7如何免费真机调试iOS应用

    Xcode 7如何免费真机调试iOS应用的简单方式: 运行Xcode后,点击菜单中的Preferences…进入Accounts标签,这里选择添加Apple ID:在弹出的对话框中登入你的Apple ...

  6. Xcode 5、Xcode 6 免证书真机调试

    我们都知道,在iOS开发中,假设要进行真机调试的话是须要苹果开发人员账号的.否则Xcode就不可以进行真机调试.仅仅可以在模拟器上执行:这就带来了非常多问题,比方iCloud编程的话你不可以用模拟器. ...

  7. ionic ios项目真机运行-不用开发者账号

    ionic ios项目真机运行-不用开发者账号 1. 添加ios平台 ionic platform add ios 2.使用XCODE打开项目 3.使用APPID登录XCODE 打开XCODE账号登录 ...

  8. Xcode 6 免证书真机调试

    前景:在 iOS 开发中,如果想进行真机调试,普遍情况是掏钱,掏钱的情况有两种: 第一种就是:直接在 Apple 官网注册为 Developer,每年99美元:当然这种作为个人开发者的话,是很有必要的 ...

  9. 第四章 Appium真机运行测试用例讲解

    -----手机自动化之Appium 手机自动化测试用例虽然可以在模拟器上运行,可是模拟器毕竟和真机还是有区别的.在第二章我们讲到了模拟器上运行测试用例后,我又花了两天的时间,研究了一下真机运行测试用例 ...

随机推荐

  1. gdb 调试的信息输出到文件

    # (gdb) set logging file <文件名> # (gdb) set logging on # (gdb) thread apply all bt # (gdb) set ...

  2. this与JavaScrip中的四种调用模式

    this是什么 方法调用模式 构造器调用模式 函数调用模式 apply/call模式 this是什么 —In most languages, ‘this’ is a reference to the ...

  3. ClientDataSet的版本兼容性

    ClientDataSet的版本兼容性 在Delphi的早期版本中,Data这个Variant类型的值内部使用的是AnsiString来存贮的字节流,但我并不确定Delphi从什么时候开始,将其改为了 ...

  4. 【docker】【redis】1.docker安装redis【单点redis服务】

    1.首先确定 需要在docker上拉取redis的哪个版本的镜像 [由于使用了aliyun的源,并且加速器也是用的阿里云的加速器,所以直接在阿里云开发者平台上找redis的镜像有哪些版本是再好不过了, ...

  5. Linux C/C++开发工具

    1. vim + ctags + taglist + cscope + cppcomplete + global 2.emacs+插件 可以查看 http://blog.163.com/yu_hong ...

  6. iOS:使用Github托管自己本地的项目代码方式二(客户端方式: Github Desktop)

    管理代码的地方主要有:Github(国外流行).CocoaChina.Cocoa4App.中国开源社区.CSDN.博客园.简书等等..... 前面已经介绍了如何使用命令行和Xcode将本地代码上传到G ...

  7. Django练习

    实现功能: 登录功能 添加功能 删除功能(未实现) 代码: index.html <!DOCTYPE html> <html lang="en"> < ...

  8. Java里面类型转换总结

    1.String 转 int int i = Integer.valueOf(my_str).intValue(); int i = Integer.parseInt(str); 2.String 转 ...

  9. Linux中的In命令

    ln是linux中一个非常重要命令.它的功能是为某一个文件在另外一个位置建立一个同步的链接,这个命令最常用的参数是-s,具体用法是: ln -s  源文件 目标文件    -s 是 symbolic的 ...

  10. Leet Code OJ 226. Invert Binary Tree [Difficulty: Easy]

    题目: Invert a binary tree. 4 / \ 2 7 / \ / \ 1 3 6 9 to 4 / \ 7 2 / \ / \ 9 6 3 1 思路分析: 题意是将二叉树全部左右子数 ...