android - 找不到adb请设置ANDROID_HOME环境变量为Android SDK根目录路径

标签 android ruby mobile cucumber appium

我收到以下错误消息:

An unknown server-side error occurred while processing the command. 
Original error: Could not find adb Please set the ANDROID_HOME 
environment variable with the Android SDK root directory path. 
(Selenium::WebDriver::Error::UnknownError)

我已经设置了以下所有内容:

info AppiumDoctor Appium Doctor v.1.4.2
info AppiumDoctor ### Diagnostic starting ###
info AppiumDoctor  ✔ The Node.js binary was found 
at:/usr/local/bin/node
info AppiumDoctor  ✔ Node version is 7.10.0
info AppiumDoctor  ✔ ANDROID_HOME is set to: 
/Users/shafiq.malik/Library/Android/sdk
info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/Home
info AppiumDoctor  ✔ adb exists at: 
/Users/shafiq.malik/Library/Android/sdk/platform-tools/adb
info AppiumDoctor  ✔ android exists at: 
/Users/shafiq.malik/Library/Android/sdk/tools/android
info AppiumDoctor  ✔ emulator exists at: 
/Users/shafiq.malik/Library/Android/sdk/tools/emulator
info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor

我不确定我错过了什么。有人可以建议吗?

最佳答案

您需要将android-sdk 的路径添加到ANDROID_HOME 环境变量中。例如C:\installation-location\android-sdk/opt/intallation-location/android-sdk

在 Windows 8 和 10 中:

  1. 在搜索中,搜索并选择:系统(控制面板)
  2. 点击“高级系统设置”链接。
  3. 点击环境变量。如果 ANDROID_HOME 环境变量不存在,点击新建。
  4. 在编辑系统变量(或新系统变量)窗口中,指定 ANDROID_HOME 环境变量的值。单击确定。关闭 单击“确定”所有剩余的窗口。

在 Linux 中:

  1. 编辑/etc/environment 文件。
  2. 附加行 export ANDROID_HOME="/opt/intallation-location/android-sdk"
  3. 保存文件,然后注销再登录。

关于android - 找不到adb请设置ANDROID_HOME环境变量为Android SDK根目录路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44184733/

相关文章:

c# - 使用 SSL 的 Android HttpListener?

Android LiveData 列表未更新

android - 通过 GPS 和 WIFI 获取当前位置

android - 创建多平台手机游戏的最佳方式?

css - 使用 CSS 在移动设备上隐藏 div

android - Android 的非阻塞 IO

ruby-on-rails - Rails 在 list 模型中重新排列订单

Ruby 系统参数

ruby-on-rails - .each 或 .all 都没有按照我认为应该的方式工作

java - J2ME中如何实现线程超时?