Genymotion、 uiautomatorviewer、 appium報錯


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 WebDriverWait from selenium.webdriver.support import expected_conditions as EC driver = 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

 

 

java.lang.SecurityException: Permission Denial: starting Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000

解決辦法:

  檢查Activity是否寫錯,self.desired_caps['appActivity'] = 'com.xxx.xxx'

 

Genymotion安裝app報錯,模擬器無法拖拉安裝  和 Genymotion "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE" errors; INSTALL_FAILED_NO_MATCHING_ABIS

解決辦法:

  下載Genymotion-ARM-Translation_v1.1.zip;下載地址

  cmd安裝命令:

    adb push  C:\Users\AS\Downloads\Genymotion-ARM-Translation_v1.1.zip   /sdcard/Download

    adb shell sh /system/bin/flash-archive.sh /sdcard/Download/Genymotion-ARM-Translation_v1.1.zip

  關閉模擬器,重啟模擬器即可

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM