appium 走过的坑

1.ios真机测试 选择udid bundelid launch启动,点击inspecter报错:

 

2016-09-01 02:43:03:695 - info: [debug] [iOS] Couldn't find ideviceinstaller, trying built-in at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/build/libimobiledevice-macosx/ideviceinstaller
2016-09-01 02:43:03:698 - error: [iOS] Could not initialize ideviceinstaller; make sure it is installed and works on your system
2016-09-01 02:43:03:736 - error: [MJSONWP] Encountered internal error running command: Error: Could not initialize ideviceinstaller; make sure it is installed and works on your system

问题原因
没有安装 ideviceinstaller

解决办法

执行命令:brew install ideviceinstaller

 

2.终端:执行命令:brew install ideviceinstaller报错:bash: brew: command not found 

原因:没有brew
解决办法:
网站查看:http://brew.sh/
终端输入:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
安装后卸载:ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
出现第一个提示敲击回车,第二个输入密码
在次错误提示
From https://github.com/Homebrew/brew
* [new branch] master -> origin/master
error: unable to unlink old '.github/CONTRIBUTING.md' (Permission denied)
error: unable to unlink old '.github/ISSUE_TEMPLATE.md' (Permission denied)
error: unable to unlink old '.github/PULL_REQUEST_TEMPLATE.md' (Permission denied)
error: unable to create file Library/Homebrew/README.md (Permission denied)
error: unable to unlink old 'Library/Homebrew/blacklist.rb' (Permission denied)
error: unable to create file Library/Homebrew/brew.rb (Permission denied)
error: unable to create file Library/Homebrew/brew.sh (Permission denied)
error: unable to unlink old 'Library/Homebrew/build.rb' (Permission denied)
error: unable to unlink old 'Library/Homebrew/build_environment.rb' (Permission denied)
error: unable to unlink old 'Library/Homebrew/build_options.rb' (Permission denied)
fatal: cannot create directory at 'Library/Homebrew/cask': Permission denied
Failed during: git reset --hard origin/master

3.安装brew报错
原因:系统版本比较高,我的是10.11.6
解决办法
1.clone brew项目到本地
git clone https://github.com/Homebrew/brew
2.移动项目文件
在执行文件的移动之前,请保证要移动到的目录文件中的相同文件移除

1).通过本地项目可知brew的目录结构,而我们所使用的命令都是/usr/local/bin文件中,因此将brew中的bin目录下的命令brew拷贝或者移动到/usr/local/bin下:(我所使用的是移动)
//进入本地项目brew中
cd brew
//移动brew到系统文件中
sudo mv bin/brew /usr/local/bin
2).移动Library
//移动Library库到/usr/local
sudo mv Library /usr/local
3).移动share文件
//移动share库到/usr/local
sudo mv share /usr/local
3.查看是否安装成功
使用brew查看是否已经移动成功.如果有以下内容则代表成功。

brew search [TEXT|/REGEX/]
brew (info|home|options) [FORMULA...]
brew install FORMULA...
brew update
brew upgrade [FORMULA...]
brew uninstall FORMULA...
brew list [FORMULA...]

Troubleshooting:
brew config
brew doctor
brew install -vd FORMULA

Brewing:
brew create [URL [--no-fetch]]
brew edit [FORMULA...]
https://github.com/Homebrew/brew
再次输入:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
brew install ideviceinstaller
出现提示:
fatal: bad revision 'HEAD'
fatal: bad revision 'HEAD'
fatal: Needed a single revision
You do not have the initial commit yet
fatal: Needed a single revision
To restore the stashed changes to /usr/local run:
'cd /usr/local && git stash pop'
==> Installing dependencies for ideviceinstaller: libtasn1, libxml2, libplist, libusb, usbmuxd, openssl, libimobiledevice, libzip
==> Installing ideviceinstaller dependency: libtasn1
==> Downloading https://homebrew.bintray.com/bottles/libtasn1-4.9.el_capitan.bot
######################################################################## 100.0%
==> Pouring libtasn1-4.9.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/libtasn1/4.9: 58 files, 437K
==> Installing ideviceinstaller dependency: libxml2
==> Downloading https://homebrew.bintray.com/bottles/libxml2-2.9.4.el_capitan.bo
######################################################################## 100.0%
==> Pouring libxml2-2.9.4.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.

OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

LDFLAGS: -L/usr/local/opt/libxml2/lib
CPPFLAGS: -I/usr/local/opt/libxml2/include

==> Summary
🍺 /usr/local/Cellar/libxml2/2.9.4: 276 files, 9.8M
==> Installing ideviceinstaller dependency: libplist
==> Downloading https://homebrew.bintray.com/bottles/libplist-1.12.el_capitan.bo
######################################################################## 100.0%
==> Pouring libplist-1.12.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/libplist/1.12: 28 files, 314.3K
==> Installing ideviceinstaller dependency: libusb
==> Downloading https://homebrew.bintray.com/bottles/libusb-1.0.20.el_capitan.bo
######################################################################## 100.0%
==> Pouring libusb-1.0.20.el_capitan.bottle.1.tar.gz
🍺 /usr/local/Cellar/libusb/1.0.20: 27 files, 492.9K
==> Installing ideviceinstaller dependency: usbmuxd
==> Downloading https://homebrew.bintray.com/bottles/usbmuxd-1.0.10_1.el_capitan
######################################################################## 100.0%
==> Pouring usbmuxd-1.0.10_1.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/usbmuxd/1.0.10_1: 12 files, 118.4K
==> Installing ideviceinstaller dependency: openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.el_capitan
######################################################################## 100.0%
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Using the sandbox
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs

and run
/usr/local/opt/openssl/bin/c_rehash

This formula is keg-only, which means it was not symlinked into /usr/local.

Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
🍺 /usr/local/Cellar/openssl/1.0.2h_1: 1,691 files, 12M
==> Installing ideviceinstaller dependency: libimobiledevice
==> Downloading https://homebrew.bintray.com/bottles/libimobiledevice-1.2.0.el_c
######################################################################## 100.0%
==> Pouring libimobiledevice-1.2.0.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/libimobiledevice/1.2.0: 65 files, 981.9K
==> Installing ideviceinstaller dependency: libzip
==> Downloading https://homebrew.bintray.com/bottles/libzip-1.1.2.el_capitan.bot
######################################################################## 100.0%
==> Pouring libzip-1.1.2.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/libzip/1.1.2: 119 files, 455.3K
==> Installing ideviceinstaller
==> Downloading https://homebrew.bintray.com/bottles/ideviceinstaller-1.1.0_2.el
######################################################################## 100.0%
==> Pouring ideviceinstaller-1.1.0_2.el_capitan.bottle.tar.gz
🍺 /usr/local/Cellar/ideviceinstaller/1.1.0_2: 7 files, 63K

4.在真机运行时报错:Permission to debug com.beijingranqi.distribution was denied. The app must be signed with a development identity (e.g. iOS Developer).
原因:机器不是开发者机器,也就是没有在企业开发者帐号上配置udid ,没有安装证书等

解决半办法:查看博主《mac 下ios设置》章节

posted on 2016-09-06 17:08  jurryfu  阅读(1219)  评论(0编辑  收藏  举报