Genymotion、 uiautomatorviewer、 appium報錯

來源:互聯網
上載者:User

標籤:drive   create   path   ret   tom   gen   webdriver   dex   虛擬化   

Genymotion模擬器啟動時報錯:

Unable to start the virtual device.The virtual device got no IP address.The VirtualBox DHCP server has not assigned an IP address to the virtual device.To find a solution,please start VirualBox.

解決辦法:

 

1、以管理員身份運行Genymotion;

 我按照網上說的設定vm virtualBox的網路、網卡、DHCP等無效果,於是自己嘗試啟動虛擬機器查看報錯內容,發現是電腦未設定虛擬化導致的,而Genymotion卻報的是網路問題,只能說考慮問題還是看根本靠譜些吧。

2、vm virtualBox正常啟動該模擬器,查看具體報錯資訊

 

 

模擬器報的錯:

 

 

 

 

進入電腦boss,設定虛擬化,後選擇模擬器的版本,即可解決

 

 

 

 

 

 

 

Genymotion下載模擬器完成時,提示unable to create virtual device:failed to import ova file

1、以管理員身份運行Genymotion;

2、刪除檔案:

 

uiautomatorviewer.bat開啟報錯:

Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn‘t exist!

解決辦法:

關閉appium重新捕獲app介面;

 

appium 1.4 使用desired_caps[‘unicodeKeyboard‘] = True 會報錯,是因為重複安裝了UnicodeIME-debug.apk 報錯如下:

selenium.common.exceptions.SessionNotCreatedException: Message: A new session could not be created. (Original error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "F:\xxx\android-sdk-windows\platform-tools\adb.exe -s P1QRMW6136 install "F:\xxx\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk""
Failed to install F:\xxx\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.android.ime without first uninstalling

解決辦法:

cmd 可卸載adb install io.appium.android.ime

 

appium1.4 不支援android版本為7報錯:

Attempt to re-install io.appium.settings without first uninstalling

解決辦法:

 

解決方案:
1、修改C:\Program Files (x86)\Appium\node_modules\appium\lib\devices\android\android.js檔案為

 

2、修改C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js檔案為

 

this.shell_grep("ps", name, function (err, stdout) {        if (err) {        logger.debug("No matching processes found");        return cb(null, []);     } ADB.prototype.shell_grep = function (cmd, grep, cb) {       if (cmd.indexOf(‘"‘) === -1) {       cmd = ‘"‘ + cmd + ‘"‘;       }      var execCmd = ‘shell ‘ + cmd + ‘| grep ‘ + grep;      this.exec(execCmd, cb);      };

 

 

appium 運行指令碼,啟動應用,彈出許可權或其他彈出框:

解決辦法:

 

from selenium.webdriver.support.ui import WebDriverWaitfrom selenium.webdriver.support import expected_conditions as ECdriver = webdriver.Remote(‘http://localhost:4723/wd/hub‘, desired_caps)# 判斷是否有許可權彈窗,根據關鍵字來確定for i in range(5):    alertWin = ("xpath", "//*[@text=‘去授權‘]")    try:        e = WebDriverWait(driver, 1, 0.5).until(EC.presence_of_element_located(alertWin ))        e.click()    except:        pass

 

Genymotion、 uiautomatorviewer、 appium報錯

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.