1、安装brew 软件包管理工具:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2、安装nodejs  :brew install node  安装完node 后需要设置通过npm安装的软件包放置位置设置为可以读写权限,chmod -R 777 /usr/local/lib/node_modules/  (注:在操作时时测试机器,赋给777权限没有问题,如果是其他机器,需要考虑是否给了不该给的权限)    其中 /usr/local/ 可以通过npm config get prefix 获得,这样会省去一些权限的问题。

3、安装macaca 参考官网:https://macacajs.github.io/environment-setup

4、安装macaca inspect :npm i app-inspector -g

  安装完后进入目录:/usr/local/lib/node_modules/app-inspector/node_modules/webdriveragent/WebDriverAgent,

  在这个目录下面新建一个文件夹并执行下命令

  mkdir -p Resources/WebDriverAgent.bundle

  sh ./Scripts/bootstrap.sh -d

用xcode 打开WebDriverAgent.xcodeproj文件,对项目文件进行重新编译,

  编译:WebDriverAgentLib编译选项

  修改Bundle id,Team选为登录xcode的appid,

编译:WebDriverAgentRunner

每个编译一定要出现succeeded才行

编译完成,就可以启动macaca inspector 命令:app-inspector --port 56789 -u f9b87274e2a24b310399ddxxxxxx

启动后再浏览器中输入localhost:56789 访问,(实际端口以执行命令显示为准),手机会安装一个程序,需要手动点击这个名为:WebDriverAgentRunner的app, 会提示要在设置中信任改开发者开发的软件,进入手机>设置>通用>设备管理 >开发者应用 >信任WebDriverAgentRunner

再次安装执行命令:

app-inspector --port 56789 -u f9b87274e2a24b310399dd56dd80f8561d99fdac --verbose

提示出错误:xctest client exit with code: 65

>> xctest-client.js:181:14 [master] pid:33863 xctest client exit with code: 65, signal: null

>> xctest-client.js:145:16 [master] pid:33863 deviceconsole exit with code: null, signal: SIGKILL

>> xctest-client.js:255:14 [master] pid:33863 Fail to start xctest: undefined

>> app-inspector:66:44 [master] pid:33863 undefined

解决办法:在xcode 中编译下:WebDriverAgentUSBClient

再删除手机上的WDA,重复启动下

app-inspector --port 56789 -u f9b87274e2a24b310399dd56dd80f8561d99fdac --verbose

在再手机中信任开发者。就可以了,这个问题是签名问题

又由于macaca inspector 无法查看所有的元素,只有通过代码获取运行时xml页面元素布局   获取xml内容方法为:System.out.println(driver.getPageSource());

获取如下,有了这个xml文件内容,就能根据实际内容得到xpath  name 登录内容,完美解决元素查找问题

<?xml version="1.0" encoding="UTF-8"?><AppiumAUT><XCUIElementTypeApplication type="XCUIElementTypeApplication" name="xxxx" label="xxxx" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeWindow type="XCUIElementTypeWindow" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeNavigationBar type="XCUIElementTypeNavigationBar" name="我的xxxx" visible="true" enabled="true" x="0" y="20" width="414" height="44">
<XCUIElementTypeButton type="XCUIElementTypeButton" visible="true" enabled="true" x="12" y="26" width="41" height="30"/>
<XCUIElementTypeButton type="XCUIElementTypeButton" name="返回" label="返回" visible="true" enabled="true" x="12" y="31" width="21" height="22"/>
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="我的xxxx" name="我的xxxx" label="我的xxxx" visible="true" enabled="true" x="170" y="28" width="74" height="27"/>
<XCUIElementTypeButton type="XCUIElementTypeButton" name="MyReceiveSearch" label="MyReceiveSearch" visible="true" enabled="true" x="367" y="29" width="27" height="25"/>
</XCUIElementTypeNavigationBar>
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="64" width="414" height="672">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="64" width="414" height="57">
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="xxxx(0)" name="xxxx(0)" label="xxxx" visible="true" enabled="true" x="0" y="64" width="138" height="57"/>
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="xxxx(14)" name="xxxx14)" label="xxxx" visible="true" enabled="true" x="138" y="64" width="138" height="57"/>
<XCUIElementTypeStaticText type="XCUIElementTypeStaticText" value="xxxx(10)" name="xxxx(10)" label="xxxx" visible="true" enabled="true" x="276" y="64" width="138" height="57"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="117" width="138" height="4"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="120" width="414" height="1"/>
</XCUIElementTypeOther>
<XCUIElementTypeScrollView type="XCUIElementTypeScrollView" visible="true" enabled="true" x="0" y="120" width="414" height="616">
<XCUIElementTypeTable type="XCUIElementTypeTable" name="无更多记录" label="无更多记录" visible="true" enabled="true" x="0" y="120" width="414" height="616"/>
</XCUIElementTypeScrollView>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeOther>
</XCUIElementTypeWindow>
<XCUIElementTypeWindow type="XCUIElementTypeWindow" visible="false" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="false" enabled="true" x="0" y="0" width="414" height="736"/>
</XCUIElementTypeWindow>
<XCUIElementTypeWindow type="XCUIElementTypeWindow" visible="true" enabled="true" x="0" y="0" width="414" height="736">
<XCUIElementTypeStatusBar type="XCUIElementTypeStatusBar" visible="true" enabled="true" x="0" y="0" width="414" height="20">
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="false" enabled="true" x="0" y="0" width="414" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" visible="true" enabled="true" x="0" y="0" width="414" height="20">
<XCUIElementTypeOther type="XCUIElementTypeOther" name="信号强度:5 格(共 5 格)" label="信号强度:5 格(共 5 格)" visible="true" enabled="true" x="6" y="0" width="34" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" name="中国电信 网络" label="中国电信 网络" visible="true" enabled="true" x="43" y="0" width="50" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" value="SSID" name="4G" label="4G" visible="true" enabled="true" x="102" y="0" width="17" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" name="下午6:13" label="下午6:13" visible="true" enabled="true" x="184" y="0" width="51" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" name="勿扰模式" label="勿扰模式" visible="true" enabled="true" x="343" y="0" width="9" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" name="方向已锁定" label="方向已锁定" visible="true" enabled="true" x="358" y="0" width="12" height="20"/>
<XCUIElementTypeOther type="XCUIElementTypeOther" name="电池电量:100%, 使用交流电源" label="电池电量:100%, 使用交流电源" visible="true" enabled="true" x="376" y="0" width="33" height="20"/>
</XCUIElementTypeOther>
</XCUIElementTypeStatusBar>
</XCUIElementTypeWindow>
</XCUIElementTypeApplication></AppiumAUT>

Macaca,app-inspector安装的更多相关文章

  1. Macaca app inspector-ios真机设备UI查看器

    前言: App Inspector:浏览器端的移动设备 UI 查看器,使用树状态结构查看 UI 布局,自动生成 XPaths.官网:https://macacajs.github.io/app-ins ...

  2. App Inspector 功能详解

    前言: App Inspector:浏览器端的移动设备 UI 查看器,使用树状态结构查看 UI 布局,自动生成 XPaths 官网:https://macacajs.github.io/app-ins ...

  3. Android APP的安装路径

    转载自:http://blog.csdn.net/libaineu2004/article/details/25247711 一.安装路径在哪? Android应用安装涉及到如下几个目录: syste ...

  4. mac osx App store 安装软件 发生错误

    app store 安装软件时发生错误 解决办法: 1. 进入如下目录: sh-3.2# cd Library/Application\ Support/App\ Store/ sh-3.2# pwd ...

  5. iOS中 CocoaPods Mac App的安装和使用 韩俊强的博客

    CocoaPods Mac App的安装和使用 CocoaPods桌面应用版下载地址:https://cocoapods.org/app打开应用会提示你是否安装命令行工具,选择install就也可以在 ...

  6. 【翻译】为Ext JS和Sencha Touch开发人员准备的应用程序监测(App Inspector)

    和其他的Sencha开发人员一样,我会花费大约半天的时间在我喜欢的IDE工具上编写JavaScript,而另一半时间则是在浏览器上测试和调试我的应用程序.在过去几年,每一个主要的浏览器都已大为改善.现 ...

  7. app的安装与卸载测试点

    安装 1)软件在不同操作系统(Palm OS.Symbian.Linux.Android.iOS.Black Berry OS .Windows Phone )下安装是否正常. 2)软件安装后的是否能 ...

  8. ios真机调试教程(不上架App Store安装到手机)

    原文 不上架App Store安装到手机调试测试,需要用到ios真机调试证书打包的ipa才能安装到非越狱的手机使用. 2017年最新整理的ios真机调试的详细图文步骤流程,轻松的把你开发的ios ap ...

  9. iOS APP下载安装时,如果出现此时无法下载安装APP的字样时,一些解决思路

    1.在iosAPP下载安装时,如果出现此时无法下载安装APP的字样时,可能是苹果系统进行了支持更新,并需要我们确认条约.至于如何判断是否是苹果系统进行了更改,只需要我们进入开发者账号,进入我的账户(A ...

  10. CoreData(数据库升级 )版本迁移-iOS App升级安装

    版权声明:本文为博主原创文章,未经博主允许不得转载. 如果IOS App 使用到CoreData,并且在上一个版本上有数据库更新(新增表.字段等操作),那在覆盖安装程序时就要进行CoreData数据库 ...

随机推荐

  1. 如何查看linux版本 如何查看LINUX是多少位

    一.如何得知自己正在使用的linux是什么版本呢,下面的几种方法将给你带来答案! 1. 查看内核版本命令: 1) [root@q1test01 ~]# cat /proc/version Linux ...

  2. hdu 5339 Untitled【搜索】

    题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5339 题意:一个整数a 和一个数组b.问你能否在b中取出r个元素排列组成c数组满足a%c1%c1%-. ...

  3. SAS学习笔记之函数应用

    今天在做数据需求的时候遇到一些问题,因为不能够在数据库里面做,仅仅好在SAS里面实现.这就遇到了一些麻烦,须要使用一些函数实现部分功能,如查找字段中某个特殊字符出现的次数,查找某个字符的位置等,以下一 ...

  4. kill -signal

    1. SIGHUP 启动被终止的进程,可让该PID重新读取配置文件,类似于重启服务 对应的数字为1 9.SIGTERM 以正常的结束进程来终止进程 15.SIGSTOP 暂停一个进程相当于crtl+z

  5. 制作个人开发IDE

     1.打开VS2013,新建项目: 2.点击下一步,下一步.到达例如以下界面: 3.下一步 watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvdG90b3R ...

  6. 在 Ubuntu16.04上安装并使用Docker

    介绍 Docker是一个开放源代码软件项目,让应用程序布署在软件容器下的工作可以自动化进行,借此在Linux操作系统上,提供一个额外的软件抽象层,以及操作系统层虚拟化的自动管理机制[1].Docker ...

  7. HP Vertica Analytics Platform 评測

    1.vertica概念 面向数据分析的数据仓库系统解决方式 2.vertica关键特性 Ø  标准的SQL接口:能够利用已有的BI.ETL.Hadoop/MapReduce和OLTP环境 Ø  高可用 ...

  8. linux的MACHINE_START-MACHINE_END(转)

    转自: http://blog.sina.com.cn/s/blog_753fd0b00100t8js.html 在友善mini2440提供的linux2.6.32.2内核中,有如下定义: MACHI ...

  9. WPF实现ScrollViewer滚动到指定控件处

    在前端 UI 开发中,有时,我们会遇到这样的需求:在一个 ScrollViewer 中有很多内容,而我们需要实现在执行某个操作后能够定位到其中指定的控件处:这很像在 HTML 页面中点击一个链接后定位 ...

  10. iOS 键盘变中文

    plist文件添加 Localizations 添加一项字段Chinese (simplified)