前提:已经安装了Appium1.6版本,我这里用的是GUI版本
 
环境要求:
真机iOS9.3及以上
macOS 10.11或10.12
Xcode7及以上
 

安装步骤如下

第一步:iOS真机启动需要安装libimobiledevice和ios-deploy工具
1.安装libimobiledevice
【brew install libimobiledevice —HEAD】
 
2.安装ios-deploy
【npm install -g ios-deploy】
 
 
第二步:安装WebDriverAgent(WDA)
如果是模拟器测试,不需要安装WDA,如果用真机一定要安装WDA
 
 
第三步:配置启动Desired Capabilities
注意项:
1.app或bundid使用一个即可
app:使用安装包的绝对路径(app或ipa的绝对路径),
bundId:如果已安装app可以使用bundlId免去安装(com.wuba.zhuanzhuan等)
2.automationName使用XCUITest
3.新增xcodeOrgId,为打包时选择的Development Team
4.新增xcodeSigningId,为打包时证书的名字
(证书名字和Team名称,可以在打包选择签名和Team的地方点击展开证书列表,选择other时输入框内的即为当前选择的team或证书名)
5.udid:标识手机唯一标识。如果只插了一个手机可以用auto,会自动匹配到唯一的设备
 
{
"platformName": "ios",
"platformVersion": "9.3",
"bundleId": "com.wuba.zhuanzhuan",
"app": "/Users/a58/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos/zhuanzhuan.app",
"deviceName": "ZhuanZhuan",
"automationName": "XCUITest",
"udid": "c957fb5ec67c9d4568fdb206a4cb8f65b823896f",
"xcodeOrgId": "xxx",
"xcodeSigningId": “xxx"
}
 
然后Start Session能够打开Inspector页面即表示配置成功(GUI Appium界面的操作详见另一篇随笔:http://www.cnblogs.com/meitian/p/7360055.html)

官方给出的一些日志文件地址,不用时可以进行删除
$HOME/Library/Logs/CoreSimulator/*
$HOME/Library/Developer/Xcode/DerivedData/*

Start Session时遇到的问题如下:

问题1:
An unknown server-side error occurred while processing the command. Original error: Could not create simulator with name 'appiumTest-55a8ede2-1b12-41ac-a37a-41d992a58bd0', device type id 'c957fb5ec67c9d4568fdb206a4cb8f65b823896f' and runtime id '9.3'. Reason: 'simctl error running 'create': Invalid device type: c957fb5ec67c9d4568fdb206a4cb8f65b823896f'
 
解决方法:
Appium1.6也必须设置udid,在启动的Desired Capabilities增加udid
 
问题2:
Error
An unknown server-side error occurred while processing the command. Original error: Could not install app: 'Command 'ios-deploy --id c957fb5ec67c9d4568fdb206a4cb8f65b823896f --uninstall --bundle /Users/a58/Library/Developer/Xcode/DerivedData/Build/Products/Release-iphoneos/zhuanzhuan.app' exited with code 253'
 
 
解决方法:
将启动Desired Capabilities中的app路径换为Debug包的地址,不要使用Release的地址
 
问题3:使用模拟器,appium 启动模拟器的session
An unknown server-side error occurred while processing the command. Original error: Command 'open -Fn '/Applications/Xcode 2.app/Contents/Developer/Applications/Simulator.app' --args -CurrentDeviceUDID 2D0F53CD-ECE6-4BBC-8062-3DD0A76111FE' exited with code 1
 
解决方法:
重新启动appium server,然后再启动start new session
 
原因:
我电脑上有Xcode8和Xcode7两个版本,曾今切换到Xcode7过,然后后来又切换回Xcode8了,然后把Xcode7删除了。
但是Appium这里没更新地址,启动的仍然是旧地址Xcode2.app。所以重启一下就生效了
 
问题4:start new session时安装app失败(code=22)
[MJSONWP] Encountered internal error running command: Error: simctl error running 'install': An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22): Failed to install the requested application
 
解决方法:
Desired Capabilities 的app传递Debug包地址,例如:~/Library/Developer/Xcode/DerivedData/Build/Products/Debug-iphoneos
 
原因:
Appium不支持release包,只支持debug包
 
问题5:启动时xcodebuild失败,code=65
An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 65
 
解决方法:编译安装WebDriverAgent
具体操作步骤详见第二步
 
 
 
 
 

Appium1.6启动iOS真机的更多相关文章

  1. 如何在 iOS 真机运行 Appium

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

  2. ios真机中Text组件出现多余边框

    问题 ios真机中Text组件出现多余边框(模拟器不会出现,真机会出现该问题). 原因 在ios启动页设置中,预设的尺寸要求与设置中图片尺寸不符合导致屏幕精度计算出现问题(启动屏分辨率错误设置会导致手 ...

  3. mac 下 配置appium +ios真机环境

    mac系统:10.11.6 xcode:7 appium:1.5.3 iphone: 6 p 1.搭建 appium 安卓的环境: 1.jdk 2.sdk 3.appium 4.配置环境变量 mac下 ...

  4. appium ios真机自动化环境搭建&运行(送源码)

    appium ios真机自动化环境搭建&运行(送源码) 原创: f i n  测试开发社区  6天前 Appium测试环境的搭建相对比较烦琐,不少初学者在此走过不少弯路 首先是熟悉Mac的使用 ...

  5. appium ios真机自动化环境搭建&运行(送源码)

    appium ios真机自动化环境搭建&运行(送源码) 原创: f i n  测试开发社区  6天前 Appium测试环境的搭建相对比较烦琐,不少初学者在此走过不少弯路 首先是熟悉Mac的使用 ...

  6. iOS 真机测试时报错:Provisioning profile "iOS Team Provisioning Profile: XXX” doesn't include the currently selected device “XXX”.

    这几天因工作需要,去给客户演示iOS项目打包的过程.之前演示都是顺利的,但后来客户自己操作时打电话说遇到了问题,出现报错. 就过去看了一下,发现一个很陌生的错误提示: The operation co ...

  7. iOS 真机调试不能连接网络的排错过程

    开发环境: macOS 10.12.1 Xcode 8.1 Qt 5.8 gSOAP 2.8 iPhone 6S+iOS 10.1.1   问题: 使用 Qt Quick 写了一个跨平台的应用,在Wi ...

  8. IOS真机测试

    学习了两天的Android开发,我感觉Android开发跟IOS开发和.NET平台下的开发有点不同,Android开发我更觉得跟web(Html)倒是有类似的地方,都是节点标签显示的,当然个人理解,感 ...

  9. iOS真机测试,为Provisioning添加设备 -- based xcode6[原]

    iOS真机测试,  我们需要添加几台新的设备进行测试.我们只需要对Provisioning Profiles 进行更新. 1. 在苹果开发者中心添加测试设备 打开苹果Certificates, Ide ...

随机推荐

  1. 为啥我做的RFM模型被人说做错了,我错哪了?

    本文转自知乎 作者:接地气的陈老师 ————————————————————————————————————————————————————— 有同学问:“为啥我做的RFM模型被客户/业务部门批斗,说 ...

  2. py库: pyautogui (自动测试模块,模拟鼠标、键盘动作)

    PyAutoGUI 是一个人性化的跨平台 GUI 自动测试模块 pyautogui 库 2017-10-4 pip install pyautogui python pip.exe install p ...

  3. 详解一个ThreadLocal 的谜题

    多线程如果不理解透彻, 那么 ThreadLocal 始终是有些会有所迷糊的. ThreadLocal 本身的命名有有问题, 这些美国精英整出来的技术,再加上一个奇怪的命名.对我们中国人来说,就是一场 ...

  4. 同时安装python2和python3环境

    一.同时安装两个环境 https://www.cnblogs.com/zhengyihan1216/p/6011640.html 二.快速安装django: https://blog.csdn.net ...

  5. jQuery 移除事件与模拟事件

    <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http ...

  6. idea 关闭自动保存,未保存星号提醒, springboot + freemarker 热部署

    1,自动保存 File > setting 去掉下图勾选 2,未保存文件星号提示 File > Settings 3,spring boot 项目 热部署 3.1,pom文件添加依赖 &l ...

  7. 用Redis实现分布式锁 与 实现任务队列

    这一次总结和分享用Redis实现分布式锁 与 实现任务队列 这两大强大的功能.先扯点个人观点,之前我看了一篇博文说博客园的文章大部分都是分享代码,博文里强调说分享思路比分享代码更重要(貌似大概是这个意 ...

  8. Dubbo 消费者

    1. pom <dependency> <groupId>com.alibaba</groupId> <artifactId>dubbo</art ...

  9. Spring Cloud (5)hystrix 服务降级

    一.是什么 二. 2.1 2.2 2.3 2.4 2.5 yml

  10. cin.tie与sync_with_stdio加速输入输出

    在LeetCode上练习习题的时候每次AC之后都会去看别人的代码,几乎每次都能遇到cin.tie与sync_with_stdio.类似这样: static auto x = [](){ std::io ...