calabash testing setup, ANDROID_HOME path - android

Im trying to use calabash and android for testing. So it is just a started and installed calabash. The problem comes when I try to execute the first test when I run:
calabash-android run myAPP.apk
I get a response:
`raise_if_android_home_not_set': Please set the ANDROID_HOME environment variable (RuntimeError)
How do I setup ANDROID_HOME?
Where do I setup ANDROID_HOME?
From your experience, do you recommend calabash?
Thanks

Before the calabash-android run command:
From the terminal just run: export ANDROID_HOME=/Applications/adt-bundle-mac-x86_64/sdk
Were you replace the path with the path of your sdk

Edit your ~/.profile file and add in the line:
export ANDROID_HOME=PATH_TO_WHERE_SDK_INSTALLED
Where PATH_TO_WHERE_SDK_INSTALLED is replaced by the actual path to android sdk.

export PATH=$PATH:/opt/ActiveTcl-8.5/bin
Restart the shell for the changes to take effect or source it, i.e.:
source .bashrc
See my blog for more information on getting Calabash set up: whitneytaylorimura.wordpress.com

Related

Nativescript command run

I have installed Android-SDK in my ARC Linux system.
but when run command tns run android
The ANDROID_HOME environment variable is not set or it points to a non-existent directory. You will not be able to perform any build-related operations for Android.
Please help.
Thanks.
Add ANDROID_HOME and PATH in .profile file in $HOME directory as :
export ANDROID_HOME="path/to/android-sdk" export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Then try add android as :
tns platform add android
For any doubt refer here : https://github.com/NativeScript/nativescript-cli/issues/1097
This is the original post in NativeScript Github page

Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually

This is a comment Problem with ionic in ubuntu,The solution is to add the Android home to the path
But my problem is that Even the ANDROID_HOME is already in the PATH and When i Type
$ Android
In The terminal its open Android SDK
Why ionic Can not find The android Home?!!
Update
After adding android home to the path in this terminal session
The output of echo $ANDROID_HOME is the path to android Sdk
But Still accrue the same error?!
Your global PATH relies in /etc/environment so if you edit it here it should be also available in ionic.
After you edit it you can reloaded by executing:
source /etc/environment
If you are creating a ~/.profile or ~/.bash_profile in your user's home dir that will only be loaded in a shell environment.
Make sure that your /etc/environment file looks something like this:
ANDROID_HOME=/home/eics/Android/Sdk
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbi‌​n:/bin:/usr/games:/u‌​sr/local/games:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools”
The error is very clear and as you wrote in the comments
echo $ANDROID_HOME
yields an empty result.
In Ubuntu, to set an environment variable globally you edit /etc/environment and there you would add
ANDROID_HOME=/path/to/android/sdk
Where you actually provide a real path, after you have done that you might need to do source /etc/environment to make it work in your current session.
If you only want to do it for your terminal, you can edit ~/.bashrc instead and add
export $ANDROID_HOME=/path/to/android/sdk
After 4 days of searching And Tried so many methods to fix this problem
I fix it with theses instructions
Install node with nvm
Never user root to install node or npm
Now its works fine for my and ionic ca see Android SDK home
export/set $Android to ANDROID_HOME to your environment variables

Does not recognize android command in path

I'm triying to build my first cordova project, when I'm inside the project folder i tip:
sudo cordova build android
and I get the following error:
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
ERROR building one of the platforms: Error: /home/veritopsecret/hello/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
when I do echo $PATH I get:
veritopsecret#veritopsecret-SATELLITE-PRO-C50-A-1HQ:~/hello$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/home/veritopsecret/Escriptori/android-sdk-linux/tools:/home/veritopsecret/Escriptori/android-sdk-linux/platform-tools
I have also modified .profile file, but it stills say that it hasn't android command in the PATH. However, if I just write android, it opens the android sdk manager. Help please!!
As I re-read your question, I see you run sudo cordova build android
I think the issue you have is that you define ANDROID_HOME and add the android tools to the path of your user but then you use sudo to run the build.
sudo runs with elevated privileges using a user which is not your user profile that you are logged with, so the path and ANDROID_HOME are not set. (maybe try sudo echo $PATH to be sure of that).
So if you really wanted to use sudo to build, you would need either to define the vars for the sudo user or use instead sudo -E (see this page for more details : https://wiki.archlinux.org/index.php/Sudo#Environment_variables)
But actually, you should be using sudo only when installing cordova, not when using the CLI.
So, just run cordova build android and everything should be fine.

launch cocos2dx project with Android

I'm using Cocos2dx 3.0 RC1, and in the installation i typed : ./setup.py
I entered my NDK root, and my SDK root, but didn't put anything on my ANT root as explained in this tutorial : here
. But know when i use : cocos run -s ~/MyCompany/MyGame -p android, it says that my ANT_ROOT is not defined. I've installed it using Macport, but when i type ant, it says Build is missing.
I just want to create a game in Android using Cocos2dx.
You could go ahead and define ANT_ROOT in your .bash_profile.
export ANT_ROOT=<where ever it is>
export PATH=$ANT_ROOT:$PATH
I had the same problem as OP. My .bash_profile already contained the exports; however it seems that it wasn't loaded. So just
source ~/.bash_profile
did the trick!
For macOS:
Install Homebrew. Run brew install ant. Add the export (with correct location) to your .bash_profile file:
export ANT_ROOT=/usr/local/bin

How do i run the Android command line tools?

I'm still pretty new to Android and programming in general, and I can't seem to get the command line tools packaged with the Android SDK to work. I'm running Mac OSX and each time I try to run layoutopt, for example, the terminal returns, *-bash: cmd: command not found
*
Also, is it okay to have my SDK located in the Developer directory and my android project in some unrelated directory when using these tools?
If you want you can put the path in your ~/.bash_profile so you can call it from anywhere:
export ANDROID_HOME=/Users/<username>/path/to/sdk/tools
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
You may want to include also the platform-tools into your ~./bash_profile
### Android dev tools
export ANDROID_HOME="/Users/myusername/DEV/tools/adt-bundle-mac-x86_64/sdk"
export PATH="$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$PATH"
You will need to start a new terminal session or run
source ~/.bash_profile
to loads the values immediately without having to open a new terminal session.
The current (2016-08-17) answer to this question is:
~/Library/Android/sdk
So my bash_profile contains:
export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/platform-tools:$ANDROID_HOME/tools
I figured it out. I needed to go to the /tools directory in the SDK folder and type in:
./layoutopt <directorypath>
Problem is your command line tool is not seeing required programs from /path/to/sdk/tools.
One solution as user NKijak mentioned is to add those tools to your Home path and the other is to run command line from location where your sdk tools are stored. Here is a tutorial how to do just that http://hathaway.cc/2008/06/how-to-edit-your-path-environment-variables-on-mac-os-x/
Other way is, when opening command line just change your current dir to /path/to/sdk/tools and then run the tools. In windows you can just shift+right click in file explorer and pick open command windows here I am not sure is there equivalent on MacOS but there are some extensions you can install to add this option. Also total commander in windows has command line where you can start command line from current location there are similar programs on mac like Midnight Commander that have same option.
Here is a good description:
To connect to the console of any running emulator instance at any time, use this command:
telnet localhost <console-port>

Categories

Resources