mac 搭建ios app-inspector環境

點擊進入官網

一、安裝

1.安裝macaca-li
npm install macaca-cli -g
2.檢查macaca環境

只要打印出的結果都綠色的日誌信息,就表示環境是好的

macaca doctor
3. 安裝app-inspector
npm install app-inspector -g
4. 安裝ios代理
brew install ios-webkit-debug-proxy
brew install usbmuxd
5. 安裝IOS驅動
npm install macaca-ios -g

二、使用

iOS獲得設備id的方法:

  • 真機的獲取方法:
idevice_id -l
  • 虛擬器的獲取方法:
xcrun simctl list

=====================================================

啓動app-inspector

app-inspector -u 你的uuid --verbose

在這裏插入圖片描述

三、安裝或使用過程中出現問題

  1. 需要配置 ::1 localhost
vim /etc/hosts

新增一行把 ::1 localhost 寫進去就好了

  1. app-inspector 始終停留在waiting device start…
  2. xctest client exit with code: 65, signal: null
cd /usr/local/lib/node_modules/appinspector/node_modules/xctestwd/XCTestWD
open XCTestWD.xcodeproj

對XCTestWDUITests 和 XCTestWD 勾選auto 和開發者信息、更換bundleId,
在這裏插入圖片描述
4. 在2中, product——>build時可能出現:Module compiled with Swift 5.0.0 cannot be imported by the Swift 5.1 compiler

我沒有升級xcode,而是卸載了app-inspector, 再重新安裝了一遍,進行完2就好了。

  1. 運行macaca doctor 出現 Command Line Tools: iproxy[usbmuxd] is uninstalled

brew install usbmuxd

四、python 使用app-inspect定位元素

driver.find_element_by_name(“name或accessibility id")
driver.find_element_by_xpath(“xpath地址")
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章