Appium 【已解决】mac 上安装 appium(0.18) 记录源码 / 非源码安装都

chuyaoyao · 2014年04月08日 · 最后由 chuyaoyao 回复于 2014年04月10日 · 1451 次阅读
本帖已被设为精华帖!

方法一:
1.源码安装 appium
下载源码:
git clone https://github.com/appium/appium
2.使用 brew 安装 node(一定要用 brew)
3.安装 npm install -g 源码文件夹
npm install -g ./appium
4.启动 server
官网上写的
sudu grunt authorize_ios
但是 grunt 不可执行的命令
那就安装 grunt-cli 和 grunt
5.之后执行还是有问题


方法二:
1.brew install node
2.npm install -g appium
3.sudo authorize_ios
出错:
chuyaoyaodeiMac:bin chuyaoyao$ sudo authorize_ios
error: Appium will not work if used or installed with sudo. Please rerun/install as a non-root user. If you had to install Appium using sudo npm install -g appium, the solution is to reinstall Node using a method (Homebrew, for example) that doesn't require sudo to install global npm packages.
3.若不用 sudo 直接输入 authorize_ios
chuyaoyaodeiMac:bin chuyaoyao$ authorize_ios
Enabling DevToolsSecurity
Updating security db for developer access
Granting access to built-in simulator apps
[Error: stderr maxBuffer exceeded.]
官网说这个 bug 已经修复了 可是我这样运行还是有的 ,亲们看下我的版本:
chuyaoyaodeiMac:bin chuyaoyao$ appium -v
0.18.0

共收到 7 条回复 时间 点赞

#6 楼 @lihuazhang 恩恩 ~ 按照你的步骤 安装成功了 多谢指点

#5 楼 @chuyaoyao 。。。你是不是要运行 sudu grunt authorize_ios? 这个是在你源码下运行的啊,请注意你的 grunt file 在你源码下。你 -g 就装到全局去了。 你需要在源码目录安装各种依赖才能运行 sudu grunt authorize_ios。 请看你的 package.json

#4 楼 @lihuazhang 不加 g 的话 好像没有装上 哦 。因为我输入 appium -v 的时候 没有输出版本号,/usr/local/bin 里面没有 appium 的相关命令 /usr/local/lib//node_modules 里面也没有 appium ,噶感觉没有装上哇。

#2 楼 @chuyaoyao 为啥要加 g ………

看来当前文件夹下没有 authorize_ios 这个 task
那么执行 “sudo grunt /usr/local/lib/node_modules/appium/bin/authorize-ios.js”
竟然这样的错误:
error: Appium will not work if used or installed with sudo. Please rerun/install as a non-root user. If you had to install Appium using sudo npm install -g appium, the solution is to reinstall Node using a method (Homebrew, for example) that doesn't require sudo to install global npm packages.
————————————————————————————————————————
在看一下 我的 node 是不是用 brew 安装的
chuyaoyaodeiMac:bin chuyaoyao$ ls -la
total 56
drwxrwxr-x 10 root admin 340 4 9 11:34 .
drwxrwxr-x 16 root admin 544 4 8 21:28 ..
lrwxr-xr-x 1 chuyaoyao admin 40 4 9 11:34 appium -> ../lib/node_modules/appium/bin/appium.js
lrwxr-xr-x 1 chuyaoyao admin 47 4 9 11:34 appium-doctor -> ../lib/node_modules/appium/bin/appium-doctor.js
lrwxr-xr-x 1 chuyaoyao admin 47 4 9 11:34 authorize_ios -> ../lib/node_modules/appium/bin/authorize-ios.js
-rwxr-xr-x 1 chuyaoyao admin 813 4 4 21:16 brew
lrwxr-xr-x 1 chuyaoyao admin 39 4 8 15:29 grunt -> ../lib/node_modules/grunt-cli/bin/grunt
lrwxr-xr-x 1 chuyaoyao admin 31 4 8 21:28 node -> ../Cellar/node/0.10.26/bin/node
drwxr-xr-x 3 chuyaoyao staff 102 4 8 16:23 node_modules
lrwxr-xr-x 1 chuyaoyao admin 38 4 8 21:29 npm -> ../lib/node_modules/npm/bin/npm-cli.js

@lihuazhang 按照你说的:
1.下载源码
2.到源码的文件夹里面执行 ‘npm install’。ps:但是不加 -g ,没有将命令添加到/urs/local/bin 下面 所以我在这里执行的是 “npm install -g”
3.在源码的文件夹下 执行 “sudo grunt authorize_ios ”
报错信息:
chuyaoyaodeiMac:appium chuyaoyao$ sudo grunt authorize_ios
Password:
Warning: Task "authorize_ios" not found. Use --force to continue.

Aborted due to warnings.

第一种,你代码拉下来以后,需要运行 npm install 下载 nodejs 的依赖包啊。

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册