无法通过 Windows 10 上的 Appium 启动计算器显示错误

Posted

技术标签:

【中文标题】无法通过 Windows 10 上的 Appium 启动计算器显示错误【英文标题】:Unable to Launch calculator through Appium on windows 10 shown error 【发布时间】:2016-03-25 22:16:06 【问题描述】:

当我尝试通过安装在 Windows 10 上的 appium 在 android 上启动计算器时,会显示以粗体标记的错误。请帮助

info: [debug] 执行 cmd: "C:\Program Files\Android\android-sdk\platform-tools\adb.exe" -s NTIO030423 install "C:\Program Files\Appium\node_modules\appium\build \settings_apk\settings_apk-debug.apk"

info: [debug] 正在将解锁助手应用推送到设备... 信息:[调试] 执行 cmd:“C:\Program Files\Android\android-sdk\platform-tools\adb.exe”-s NTIO030423 install “C:\Program Files\Appium\node_modules\appium\build\unlock_apk\ unlock_apk-debug.apk" 信息:启动应用程序 信息:[调试] 试图杀死所有“uiautomator”进程 信息:[调试]使用“uiautomator”获取所有进程 信息:[调试] 执行 cmd:“C:\Program Files\Android\android-sdk\platform-tools\adb.exe”-s NTIO030423 shell “ps 'uiautomator'” 信息:[调试]未找到匹配的进程 信息:[调试]运行引导 信息:[调试] 生成:C:\Program Files\Android\android-sdk\platform-tools\adb.exe -s NTIO030423 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com .android.calculator2 -e disableAndroidWatchers false 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:numtests = 1 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:流= 信息:[调试] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap: 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:id=UiAutomatorTestRunner 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:test=testRunServer 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:class=io.appium.android.bootstrap.Bootstrap 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS:当前 = 1 信息:[调试] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE:1 info: [debug] [BOOTSTRAP] [debug] 在端口 4724 上打开的套接字 info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready 信息:[调试] [BOOTSTRAP] [调试] 正在加载 json... 错误:未处理的错误:错误:getaddrinfo ENOENT 在 Object.exports._errnoException (util.js:746:11) 在 errnoException (dns.js:49:15) 在 GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:94:26) 上下文: [POST /wd/hub/session "desiredCapabilities":"appPackage":"com.android.calculator2"," appActivity":"com.android.calculator2.Calculator","platformName":"Android","deviceName":"Moto G","platformVersion":"6.0"] info: [debug] [BOOTSTRAP] [debug] 注册的崩溃观察者。

【问题讨论】:

【参考方案1】:

当你的路径设置不正确时会发生这种情况。非常你的 PATH 变量和 ANDROIDHOME @varunnadim

【讨论】:

【参考方案2】:

这是因为它无法解析 dns 名称...

确保在网络配置中添加 dns 服务器地址。

如果您使用的是本地主机,那么您需要有效的互联网连接才能解析为有效的 ip...在这种情况下,请检查您的互联网连接

【讨论】:

以上是关于无法通过 Windows 10 上的 Appium 启动计算器显示错误的主要内容,如果未能解决你的问题,请参考以下文章

findElement 在 Android 上的 Appium 中不起作用

appium+android+windows --- 等待不工作 ["dumpWindowHierarchy"]

Appium Android中无法拖放

无法在 Windows 中为 android 模拟器连接 appium 检查器

Python +Appium 实现app自动化测试

断点无法通过 Windows 10 和 WSL2 上的 Visual Studio Code 在 Chrome 中调试 React 应用程序