标签:des style blog http color os io ar for
看了 http://blog.csdn.net/today520/article/details/36378805
的文章,终于在真机上面测试成功。
由于没有开发者账号,不能发布应用到机器上面。所以就用了网易新闻的客户端来测试
首先得到bundleId。
在应用的Info.plist文件中可以找到
测一把,看看是否正确
https://itunes.apple.com/lookup?bundleId=com.netease.news
成功会返回应用应用信息,json格式
首先终端命令启动appium:
appium -U xxxxxxxxxxxxxxxxxxxxxx --app com.netease.news
-u 后面是udid
--app后面是应用的bundleId
关键代码
DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); capabilities.setCapability("platformVersion", "7.1"); capabilities.setCapability("platformName", "iOS"); capabilities.setCapability("deviceName", "iPhone Simulator"); //capabilities.setCapability("app", app.getAbsolutePath()); capabilities.setCapability("app", "com.netease.news"); driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); values = new ArrayList<Integer>();
另外还参考了appium官网文档:
http://appium.io/slate/en/master/?ruby#server-flags
标签:des style blog http color os io ar for
原文地址:http://www.cnblogs.com/zhangminjie/p/3959773.html