下載 xcode
下載代碼源
遇到報(bào)錯(cuò):
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
打開(kāi)Xcode > Preferences > Locations :更改一下 Command Line Tools選項(xiàng)找到.app 包:
.../<current User>/Library/Developer/XCode/DerivedData/<Project name>/Build/Products
有:Debug-iphoneos 和 Release-iphoneos以及Debug-iphonesimulator配置appium -xcode模擬機(jī)系統(tǒng):
desired_caps['platformName'] = 'ios'
desired_caps['platformVersion'] = '12.2'
desired_caps['deviceName']='iPhone Simulator'
desired_caps['newCommandTimeout'] = 2000000
desired_caps['app'] = '/Users/jingkewang/Library/Developer/Xcode/DerivedData/PapayaFM-atelnccomhgeytepkxznuzluimtu/Build/Products/Debug-iphonesimulator/PapayaFM Pre.app'
desired_caps ['automationName']: "XCUITest"
desired_caps["resetKeyboard"] = "True"
desired_caps['unicodeKeyboard'] = "True"獲取元素
Accessibility Inspector是xcode中自帶的一個(gè)檢測(cè)工具
在Xcode->Open Developer Tool->Accessibility Inspector打開(kāi)該工具, 該工具需要在Mac的安全性與隱私里邊設(shè)置輔助功能的權(quán)限, 即允許該工具控制電腦.卸載xcode 模擬機(jī) app
在xcode8上運(yùn)行項(xiàng)目之后,模擬器上想刪除這個(gè)應(yīng)用,但是發(fā)現(xiàn)增加了3DTouch功能,這個(gè)跟之前的長(zhǎng)按刪除優(yōu)點(diǎn)沖突,按的力度不容易掌控。
解決辦法:
1.選中圖標(biāo),再用三只手指同時(shí)長(zhǎng)按觸摸板。
2.關(guān)閉模擬器的3DTouch功能:Hardward -> Touch Pressure->Use Trackpad Force 勾選掉。
6.模擬輸入時(shí)報(bào)錯(cuò):
An unknown server-side error occurred while processing the command. Original error: Error Domain=com.facebook.WebDriverAgent Code=1 "Keyboard is not present" UserInfo={NSLocalizedDescription=Keyboard is not present}
因?yàn)閕os 模擬器彈不出鍵盤(pán)。 解決辦法:
由于在iOS8.0及以后的模擬器中,Xcode默認(rèn)是使用電腦鍵盤(pán)作為外接鍵盤(pán)。 選中模擬器,
Hardware->Keyboard->消選Connect Hardware Keyboard即可...
driver.get_window_size() 獲取size 時(shí)報(bào)錯(cuò)
"""
selenium.common.exceptions.WebDriverException: Message: The URL '/wd/hub/session/2763af95-8c0c-4533-8b73-0eae25e5a026/window/size' did not map to a valid resource
"""
解決方法:參考 https://testerhome.com/topics/16435?locale=en模擬滑動(dòng)
ios 高版本已經(jīng)不支持 swipe,tap,flick