【问题标题】:Not able to run automation script of python(mac)无法运行python(mac)的自动化脚本
【发布时间】:2018-12-16 16:33:09
【问题描述】:

我正在使用https://github.com/appium/python-client 框架来运行自动化。

运行脚本时出现以下错误。

异常:消息:发生未知的服务器端错误,同时 处理命令。原始错误: packageAndLaunchActivityFromManifest 失败。原始错误:不能 find aapt 请使用以下设置 ANDROID_HOME 环境变量 Android SDK 根目录路径。

另外,我在 mac 上设置了 ANDROID_HOME 环境变量。

有人知道怎么解决吗?

【问题讨论】:

    标签: python python-3.x appium appium-android python-appium


    【解决方案1】:

    此错误与您正在使用的库无关。请在终端中运行appium-doctor 并查看输出。应该是这样的

        info AppiumDoctor Appium Doctor v.1.4.3
        info AppiumDoctor ### Diagnostic starting ###
        info AppiumDoctor  ✔ The Node.js binary was found at: /usr/local/bin/node
        info AppiumDoctor  ✔ Node version is 6.11.0
        info AppiumDoctor  ✔ Xcode is installed at: /Applications/Xcode.app/Contents/Developer
        info AppiumDoctor  ✔ Xcode Command Line Tools are installed.
        info AppiumDoctor  ✔ DevToolsSecurity is enabled.
        info AppiumDoctor  ✔ The Authorization DB is set up properly.
        info AppiumDoctor  ✔ Carthage was found at: /usr/local/bin/carthage
        info AppiumDoctor  ✔ HOME is set to: /Users/poornima
        info AppiumDoctor  ✔ ANDROID_HOME is set to: /Users/poornima/Library/Android/sdk
        info AppiumDoctor  ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
        info AppiumDoctor  ✔ adb exists at: /Users/poornima/Library/Android/sdk/platform-tools/adb
        info AppiumDoctor  ✔ android exists at: /Users/poornima/Library/Android/sdk/tools/android
        info AppiumDoctor  ✔ emulator exists at: /Users/poornima/Library/Android/sdk/tools/emulator
        info AppiumDoctor  ✔ Bin directory of $JAVA_HOME is set
        info AppiumDoctor ### Diagnostic completed, no fix needed. ###
        info AppiumDoctor 
        info AppiumDoctor Everything looks good, bye!
        info AppiumDoctor 
    

    如果不是

    确保您的工具和平台工具也添加到 bash 配置文件的路径变量中。

    1. 打开 bash 配置文件open ~/.bash_profile

    2. 添加工具和平台工具

      export ANDROID_HOME=/Users/poornima/Library/Android/sdk
      export PATH=$ANDROID_HOME/platform-tools:$PATH
      export PATH=$ANDROID_HOME/tools:$PATH
      

    参考此链接:Could not find aapt with appium server

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-11-30
      • 2017-01-30
      • 2021-05-16
      • 2022-12-03
      相关资源
      最近更新 更多