在macOSX上配置AndroidViewClient和Monkeyrunner

时间:2014-05-21 08:56:08

标签: android python monkeyrunner androidviewclient

我正在尝试安装AndroidViewClient,但是存在很多问题。我在dtmilano的github上下载它。我在小牛队,我是python的新手。我知道如何使用Monkeyrunner但是因为我下载AndroidViewClient,我完全迷失了!

Si跟随github上的分步说明!当我试图启动./dump时,我收到了这条消息:

Traceback (most recent call last):
File "./tools/dump", line 126, in <module>
vc = ViewClient(*ViewClient.connectToDeviceOrExit(**kwargs1), **kwargs2)
File "/Library/Python/2.7/site-packages/androidviewclient-5.6.0- py2.7.egg/com/dtmilano/android/viewclient.py", line 1188, in __init__
adb = ViewClient.__obtainAdbPath()
File "/Library/Python/2.7/site-packages/androidviewclient-5.6.0-py2.7.egg/com/dtmilano/android/viewclient.py", line 1341, in __obtainAdbPath
raise Exception('adb="%s" is not executable. Did you forget to set ANDROID_HOME in the environment?' % adb)
Exception: adb="adb" is not executable. Did you forget to set ANDROID_HOME in the environment?

这是我的环境变量:

ANDROID_HOME=/Users/Flo/Documents/adt-bundle-mac-x86_64-20130729/sdk/
ANDROID_VIEW_CLIENT_HOME=/Users/Flo/Documents/Android/AndroidViewClient-5.1.1/AndroidViewClient/

如果我cd $ANDROID_VIEW_CLIENT_HOME,我会获取我的AndroidViewClient文件夹 我无法执行脚本..

当我这样做时:python check-import.py --debug,我得到了这个:

sys.path= ['/Users/Flo/Documents/Android/AndroidViewClient-5.1.1/AndroidViewClient/examples', '/Library/Python/2.7/site-packages/androidviewclient-5.6.0-py2.7.egg', '/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC', '/Library/Python/2.7/site-packages', '/Users/Flo/Documents/Android/AndroidViewClient-5.1.1/AndroidViewClient/src']
OK

有人可以帮助我吗?我现在已经两天了,而且我不知道我能做什么。我尝试了很多东西。删除AndroidViewClient /重新安装它,但它始终是相同的结果

1 个答案:

答案 0 :(得分:0)

我了解您使用

安装它
$ sudo easy_install --upgrade androidviewclient

然后,你应该做

$ export ANDROID_HOME=/Users/Flo/Documents/adt-bundle-mac-x86_64-20130729/sdk/

如果您希望它是持久的,请将其添加到~/.bash_profile

然后你应该能够毫无问题地执行dump。 这些工具正在尝试在某些知道位置或adb查找$ANDROID_HOME/platform-tools/adb。检查以确保adb存在且可执行。