"Resolved" on Mac Appium Error: "Could not find AAPT" set the ANDROID_HOME environment variable with the ANDROID SDK root director Y path "

Source: Internet
Author: User
Tags appium



After configuring the Appium environment in accordance with the online tutorial, the true machine runs the automated process, encountering the following error:



Appium error is as follows:


[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.]
First, use Appium-doctor for configuration checking


Appium-doctor check results, android_home and other paths have been configured:


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
Second, it is OK to check the environment variables $android_home and AAPT.
?  ~ 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.
Finally, after the command is started appium resolves the issue


Later, on the Internet to see a question (unfortunately forgot to save the link), the main reference to his command after the start of normal, manual start Appium only problem. After I try to use the command and start Appium, the problem is resolved.



Command line startup Appium:


/Applications/Appium.app/Contents/MacOS/Appium


"Resolved" on Mac Appium Error: "Could not find AAPT" set the ANDROID_HOME environment variable with the ANDROID SDK root director Y path "


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.