Could not find aapt

1.Download JDK
2.Setup environment variable
-My Computer->Right click->Properties->Advanced system settings->Environment variables.
-System Variables->New->Variable Name(JAVA_HOME)/ Variable Value(C:\Program Files\Java\jdk1.8.0_40)
-Edit Path->put (C:\Program Files\Java\jdk1.8.0_40\bin) at last.
3.Download Android sdk
Setup Environment variable
-My Computer->Right click->Properties->Advanced system settings->Environment variables.
-System Variables->New->Variable Name(ANDROID_HOME)/ Variable Value(C:\Eclipse\Juno\adt-bundle-windows-x86_64-20140624\sdk)
-Edit Path->put (%ANDROID_HOME%\tools) at last.
-Edit Path->put (%ANDROID_HOME%\platform-tools) at last.
4.cmd->type android, check android SDK manager is opening or not.
6.Download Eclipse Juno version.
7.Open eclipse->Go to Help > Install New Software.
Click Add, enter name as ADT Plugin and url
select all->next ->next->finish
8.node js installation
9.Microsoft .net framework
10.Download and install appium.exe
11.Download selenium library and add to your project.
12.Add Path to environment variable as C:\Program Files (x86)\Appium

13.Go to C:\Program Files (x86)\Appium\node_modules and select appium folder and press shift + right click-> select Open Command Window here. cmd will get open.

14.Put the command as node . -p 4724(port number used by particular device) -U 1234abcd(device id) -bp 2251(bootstrap port)

How to run the script:

15.After entering command, just run the script written in eclipse.

How to find device id:

Go to C:\Eclipse\Juno\adt-bundle-windows-x86_64-20140624\sdk\platform-tools and copy the path and enter into cmd.

now connect your android device to machine and enter command as adb devices, you will get the device id of the connected device.

PROBLEM When I run testNG then the following error is coming:

error: Problem parsing package and activity from manifest: Error: Could not find
aapt. Please set the ANDROID_HOME environment variable with the Android SDK roo
t directory path.

I have already set the ANDROID_HOME in environment variable and I have checked that aapt is also present in my build-tools

Eclipse is not reading your Environment variables. Set them in the ‘Run Configurations’:

1 Like