【已解决】mac上appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”
按照网上教程配置完appium环境后,真机跑自动化过程,遇到如下报错:
appium报错如下:
[ADB] Checking whether aapt is present
[ADB] The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for aapt.
[ADB] Error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
at Object.wrappedLogger.errorAndThrow (lib/logger.js:60:13)
at ADB.callee$0$0$ (lib/tools/system-calls.js:85:9)
at tryCatch (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
at run (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:104:47)
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/es6.promise.js:115:28
at flush (/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/babel-runtime/node_modules/core-js/library/modules/$.microtask.js:19:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)
[Error: Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path.]
首先,使用appium-doctor进行配置检查
appium-doctor校验结果,ANDROID_HOME等路径均已经配置:
Last login: Fri Jul 6 23:41:56 on ttys002
'/Applications/Appium.app/Contents/Resources/node/bin/node' '/Applications/Appium.app/Contents/Resources/node_modules/appium-doctor/appium-doctor.js'
➜ ~ '/Applications/Appium.app/Contents/Resources/node/bin/node' '/Applications/Appium.app/Contents/Resources/node_modules/appium-doctor/appium-doctor.js'
info AppiumDoctor ### Diagnostic starting ###
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 ✔ The Node.js binary was found at: /usr/local/bin/node
info AppiumDoctor ✔ HOME is set to: /Users/uc
info AppiumDoctor ✔ ANDROID_HOME is set to: /Users/uc/Library/Android/sdk4eclipse
info AppiumDoctor ✔ JAVA_HOME is set to: /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
info AppiumDoctor ✔ adb exists at: /Users/uc/Library/Android/sdk4eclipse/platform-tools/adb
info AppiumDoctor ✔ android exists at: /Users/uc/Library/Android/sdk4eclipse/tools/android
info AppiumDoctor ✔ emulator exists at: /Users/uc/Library/Android/sdk4eclipse/tools/emulator
info AppiumDoctor ### Diagnostic completed, no fix needed. ###
info AppiumDoctor
info AppiumDoctor Everything looks good, bye!
info AppiumDoctor
其次,检查环境变量$ANDROID_HOME和aapt,也是OK的。
➜ ~ echo $ANDROID_HOME
/Users/uc/Library/Android/sdk4eclipse
➜ lib aapt
Android Asset Packaging Tool
Usage:
aapt l[ist] [-v] [-a] file.{zip,jar,apk}
List contents of Zip-compatible archive.
最后,命令行appium解决问题
后来,网上看到一个提问(可惜忘记保存链接),题主提到他命令后启动正常,手工启动appium才有问题。我尝试使用命令后启动appium后,问题果然解决。
命令行启动appium:
/Applications/Appium.app/Contents/MacOS/Appium
【已解决】mac上appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the Android SDK root directory path”的更多相关文章
- Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
背景:运行代码提示找不到ADB An unknown server-side error occurred while processing the command. Original error: ...
- Mac上svn报错解决方案
具体的报错信息为:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing ...
- 解决Mac安装tesserocr报错问题 Failed building wheel for
localhost:~ jerry$ Processing /var/www/git/python/tesserocr -bash: Processing: command not found loc ...
- 解决mailx发邮件报错:esmtp-server: 504 5.7.4 Unrecognized authentication type [HK2PR02CA0167.apcprd02.prod.outlook.com] "/root/dead.letter" 11/302 . . . message not sent.
报错信息: esmtp-server: 504 5.7.4 Unrecognized authentication type [HK2PR02CA0167.apcprd02.prod.outlook. ...
- 【已解决】WinPhone模拟器报错:模拟器没法确定来宾虚拟机通信的主机ID地址。某些功能已被禁用
先看警告 再看错误信息 计算机管理打不开就==>Win+R ==>compmgmt.msc 发现,dnt在管理员权限组里面,也在Hyper-V权限组里面 看看Hyper-V的驱动有木有被禁 ...
- Mac上django 报错 [Errno 13] Permission denied: '/static'
将setting文件中的 改成:
- matplotlib报错_tkinter.TclError: no display name and no $DISPLAY environment variable
import matplotlib import matplotlib.pyplot as plt fig=plt.figure() #交互式测试,此时报错 解决办法,在引用后添加下面这一行 matp ...
- appium报错及解决方案
[已解决]mac上手动打开appium报错:“Could not find aapt Please set the ANDROID_HOME environment variable with the ...
- 解决springMVC文件上传报错: The current request is not a multipart request
转自:https://blog.csdn.net/HaHa_Sir/article/details/79131607 解决springMVC文件上传报错: The current request is ...
随机推荐
- Toast优化,解决频繁点击多次出现
日常用到Taost的机会很多,用就大家都会用,但是直接使用时,频繁点击Toast就会频繁出现,点击多少次就出现多少次,如果你不在页面的生命周期相应位置cancel掉Toast的话,即使退出了页面也是会 ...
- GO入门——3. 控制语句
1 if 条件表达式没有括号 支持一个初始化表达式(可以是并行方式) 左大括号必须和条件语句或else在同一行 支持单行模式 初始化语句中的变量为block级别,同时隐藏外部同名变量 a := 1 i ...
- Python基础之好玩的字符串格式化f-string格式
转自白月黑羽 Python3教程 : http://www.python3.vip/doc/tutorial/python/0010/#f-string-格式化 f-string 格式化 f-stri ...
- dhcp服务器(一)
DHCP服务概述: 名称:DHCP -Dynamic Host Configuration Protocol动态主机配置协议. 功能:DHCP(Dynamic Host Configuration P ...
- 解决wamp 3.0.6 访问路径出现 403 错误
<VirtualHost *:80> ServerName localhost DocumentRoot e:/wamp64/www #your local dir path <Di ...
- (转)Spring常用注解
使用注解来构造IOC容器 用注解来向Spring容器注册Bean.需要在applicationContext.xml中注册<context:component-scan base-package ...
- 大数据技术之_08_Hive学习_05_Hive实战之谷粒影音(ETL+TopN)+常见错误及解决方案
第10章 Hive实战之谷粒影音10.1 需求描述10.2 项目10.2.1 数据结构10.2.2 ETL原始数据10.3 准备工作10.3.1 创建表10.3.2 导入ETL后的数据到原始表10.3 ...
- 分布式理论(八)—— Consistent Hash(一致性哈希算法)
前言 在分布式系统中,常常需要使用缓存,而且通常是集群,访问缓存和添加缓存都需要一个 hash 算法来寻找到合适的 Cache 节点.但,通常不是用取余hash,而是使用我们今天的主角-- 一致性 h ...
- MFC进程的创建销毁、线程的创建与交互
进程的创建 STARTUPINFO si; //**成员DWORD dwFlags;表示结构体当中哪些成员有效.**STARTF_USESHOWWINDOW|STARTF_USEPOSITION PR ...
- 【转】.NET NPOI操作Excel常用函数
最近因项目接触了NPOI,感觉还是蛮不错的,网络上的教程普遍版本较老,本篇记录所常用操作,采用NPOI 2.0版本. 推荐: NPOI官方网站 NPOI 1.2.4/1.2.5 官方教程 新建Exce ...