monkeyrunner自動化測試工具--真機運行提示:could not connect to view server

連接真機,使用monkeyrunner自動化測試工具運行腳本-提示腳本easy_device=EasyMonkeyDevice(device1)附近could not connect to view server


原因:

EasyMonkeyDevice模塊用來通過ID訪問控件,而EasyMonkeyDevice和這裏沒用到的Hierarchy Viewer只能連接開發版手機或模擬器,我們普通的商業手機是無法連上的

老版本的Hierarchy Viewer可以),所以出現了以上錯誤。

這句錯誤意思是:不能連接到View Server,View Server需要模擬機或開發機,還有可能是開發機沒有開啓這項服務。

可以試試下面:

a.檢驗一臺手機是否開啓了View Server '

adb shell service call window 3

b.打開View Server

adb shell service call window 1 i32 4939


如果還不行就果斷換設備吧。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章