"appium &" 不会在 mac 中启动 appium 服务器
Posted
技术标签:
【中文标题】"appium &" 不会在 mac 中启动 appium 服务器【英文标题】:"appium &" won't start appium server in mac 【发布时间】:2019-06-19 00:26:33 【问题描述】:我已经下载了所有必需的工具并且能够设置环境变量。 macOS mojave:版本 10.14.3
我已经安装了 node、appium 和 wd:
brew install node
npm install -g appium
npm install wd
当我尝试使用 appium & 启动 appium 服务器时,出现以下错误;
[1] 49460
-bash: appium: 找不到命令
[1]+ 退出 127 应用程序
更新:
没有打开使用 npm 命令安装的应用程序。使用 npm 安装的应用显示 command not found 错误
在 macOS Mojave 10.14.2 中运行良好
使用 npm install -g appium
时的日志$npm install -g appium
npm WARN deprecated fsevents@2.0.1: Not Ready For Production
/Users/infotmt/bin/appium -> /Users/infotmt/lib/node_modules/appium/build/lib/main.js
> appium-chromedriver@4.9.0 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver
> node install-npm.js
[18:22:48] [Chromedriver Install] Installing Chromedriver version '2.44' for platform 'mac' and architecture '64'
[18:22:48] [Chromedriver Install] Opening temp file to write 'chromedriver_mac64' to...
[18:22:48] [Chromedriver Install] Opened temp file '/var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip'
[18:22:48] [Chromedriver Install] Downloading https://chromedriver.storage.googleapis.com/2.44/chromedriver_mac64.zip...
[18:22:52] [Chromedriver Install] Writing binary content to /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip...
[18:22:52] [Chromedriver Install] Extracting /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64.zip to /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64
[18:22:52] [Chromedriver Install] Creating /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac...
[18:22:52] [Chromedriver Install] Copying unzipped binary, reading from /var/folders/ng/_2f_j78n1vg4gf8xnxvx9c780000gn/T/2019025-62054-1018qcf.8dtn/chromedriver_mac64/chromedriver...
[18:22:52] [Chromedriver Install] Writing to /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver...
[18:22:52] [Chromedriver Install] /Users/infotmt/lib/node_modules/appium/node_modules/appium-chromedriver/chromedriver/mac/chromedriver successfully put in place
> appium-selendroid-driver@1.13.2 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver
> node ./bin/install.js
[18:22:54] Java version 1.8.0_202 found
[18:22:55] Ensuring /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download exists
[18:22:55] Downloading Selendroid standalone server version 0.17.0 from https://repo1.maven.org/maven2/io/selendroid/selendroid-standalone/0.17.0/selendroid-standalone-0.17.0-with-dependencies.jar --> /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server-7cf7163ac47f1c46eff95b62f78b58c1dabdec534acc6632da3784739f6e9d82.jar
[18:23:07] Writing binary content to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download/selendroid-server.jar.tmp
[18:23:07] Selendroid standalone server downloaded
[18:23:07] Determining androidManifest location
[18:23:07] Determining server apk location
[18:23:07] Extracting manifest and apk to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid/download
[18:23:07] Copying manifest and apk to /Users/infotmt/lib/node_modules/appium/node_modules/appium-selendroid-driver/selendroid
[18:23:07] Cleaning up temp files
[18:23:07] Fixing AndroidManifest icon bug
> appium-windows-driver@1.5.1 install /Users/infotmt/lib/node_modules/appium/node_modules/appium-windows-driver
> node install-npm.js
Not installing WinAppDriver since did not detect a Windows system
> fsevents@2.0.1 install /Users/infotmt/lib/node_modules/appium/node_modules/fsevents
> [ -f fsevents.node ] || npm run prepare
> heapdump@0.3.12 install /Users/infotmt/lib/node_modules/appium/node_modules/heapdump
> node-gyp rebuild
CXX(target) Release/obj.target/addon/src/heapdump.o
In file included from ../src/heapdump.cc:17:
../../nan/nan.h:1064:44: warning: 'ToString' is deprecated: Use maybe version
[-Wdeprecated-declarations]
v8::Local<v8::String> string = from->ToString(v8::Isolate::GetCurrent());
^
/Users/infotmt/.node-gyp/11.7.0/include/node/v8.h:2537:3: note: 'ToString' has
been explicitly marked deprecated here
V8_DEPRECATED("Use maybe version",
^
/Users/infotmt/.node-gyp/11.7.0/include/node/v8config.h:326:29: note: expanded
from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated(message)))
^
1 warning generated.
SOLINK_MODULE(target) Release/addon.node
+ appium@1.10.1
added 493 packages from 406 contributors and updated 2 packages in 34.024s
【问题讨论】:
而这个链接是***.com/questions/24813589/…问题的答案 这对我没有帮助 给我一些时间我会告诉你的 @akshaypatil 我尝试在另一个版本为 10.14.2 的 Mac 上安装 appium,它工作正常。在终端中输入 appium 时,它会打开 appium 服务器。 嗯,这很好,还有一件事,如果有帮助,这个解决方案对您有什么帮助,那么请投票,否则就让它成为吧.. 【参考方案1】:我的建议如下:
1。不要使用 Homebrew 安装 Node.js。
最好的方法是使用nvm
版本管理器。我在 MacOS 上与 Node.js 有很多冲突,但 nvm
是一个防弹的解决方案。
https://yoember.com/nodejs/the-best-way-to-install-node-js/
2。也强烈建议使用版本管理器
鲁比https://github.com/rbenv/rbenv 蟒蛇https://github.com/pyenv/pyenv Java http://www.jenv.be/版本管理器从系统中接管 Node/Ruby/Python/Java 管理,并允许您安装并行版本并保持模块/包/gems 等的一致性。
3。然后安装以下软件包:
npm install -g appium npm install -g appium-doctor
之后您可以查看所有 Appium 依赖项列表:
appium-doctor --ios appium-doctor --android
按照说明完成列表。
4。永远不要使用 sudo 安装模块/包/gems...。
【讨论】:
【参考方案2】:问题是我在非常旧版本的 mac 中安装了 node/npm。然后我将mac版本升级到mojave。 我通过出厂重置mac然后将其更新到最新版本来解决这个问题。之后我安装 node/npm,然后安装 appium。它现在工作正常。
【讨论】:
【参考方案3】:您可以使用桌面客户端启动 appium 服务器吗? https://github.com/appium/appium-desktop/releases/tag/v1.10.0
你也提到了这个https://github.com/appium/appium/issues/6738?
【讨论】:
Appium 桌面正在运行。问题是我在旧的 mac os 中安装了 appium 服务器版本,然后将其更新为 mojave。我通过将 mac os 清除为默认值来解决这个问题,然后更新 os。之后我再次安装了appium服务器并且它工作了【参考方案4】:检查$PATH
环境变量是否存在/Users/infotmt/bin
。
【讨论】:
【参考方案5】:尝试从发行版安装桌面版本:https://github.com/appium/appium-desktop
您是否尝试安装appium-doctor
?
尝试按照 kubano 告诉您的方式运行 npm install -g appium-doctor
。我目前在莫哈韦使用它,所以请随时问我任何问题
【讨论】:
【参考方案6】:1-> ln -fs /Users//.npm-global/lib/node_modules/appium/build/lib/main.js /usr/local/bin/appium
2-> chmod +x /usr/local/bin/appium
按照上述步骤对我有用
【讨论】:
以上是关于"appium &" 不会在 mac 中启动 appium 服务器的主要内容,如果未能解决你的问题,请参考以下文章
(Appium-Python)“使用给定的搜索参数无法在页面上找到元素”和“DOM 中不再存在元素”的区别
appium如何打开Genymotion(android)中的UC浏览器
哪位大神知道怎么用appium实现引导页的滑动,并且成功跳转到主界面?
Python操作APP -- Appium-Python-Client
原始错误:在 ["/usr/local/share/android-sdk/platform-tools/aapt"] Appium - Eclipse 中找不到“aapt”