samedi 6 février 2016

Python uiautomator doesn't works on MacOS

I wanna use uiautomator on Python to test some android apps.

When I run this single code:

from uiautomator import device as d
d.screen.on()

that show me the error below:

Traceback (most recent call last):
  File "cerrar.py", line 8, in <module>
    d.screen.on()
  File "/usr/local/lib/python2.7/site-packages/uiautomator/__init__.py", line 813, in on
    return devive_self.wakeup()

...

"$ANDROID_HOME environment not set."

I already have done the environment variables with:

vi ~/.bash_profile
export ANDROID_HOME=/Applications/android-sdk-macosx 
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

source ~/.bash_profile

Both ways android-sdk installed by android website or brew install, was tried it.

if I run: echo $ANDROID_HOME or adb devices or android

Does works well...

I can't understand what's going on whether the environment variables exists.

My equip is: MacBook Pro Yosemite OS

Aucun commentaire:

Enregistrer un commentaire