# Android SDK
PATH=$PATH:/home/sudhir/Documents/Android/sdk:/home/sudhir/Documents/Android/sdk/tools
export PATH
# For SDK version r_08 and higher, also add this for adb:
PATH=$PATH:/home/sudhir/Documents/Android/sdk/platform-tools
export PATH
# Android Home
export ANDROID_HOME=/home/sudhir/Documents/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
bash gurus,
Is this redundant? Should bottom two lines be enough?
these two lines are sufficient.
# Android Home
export ANDROID_HOME=/home/sudhir/Documents/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
Related
In my Macbook, I have set my android home as shown below in the .bash_profile. However, I get an error message saying the path is invalid when I run appium-doctor.
I've verified that I can navigate to the path in both terminal and finder.
export ANDROID_HOME=/Users/cbellard/Library/Android/sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
export JAVA_HOME=/usr/bin/java
export M2_HOME=/usr/local/apache-maven/apache-maven-3.3.9
export M2=$M2_HOME/bin
export PATH=$M2:$PATH
export PATH=${JAVA_HOME}/bin:$PATH
export PATH=/usr/local/bin:$PATH
Here is the output from appium-doctor:
I fixed this by replacing the exports in .bash_profile with identical (to human eyes) ones. So, I'm guessing at some point as I was copy-pasting some program changed one or more of the characters to an identical one.
I have followed all steps mentioned from here
I have set ANDROID_HOME and set PATH in bashrc file.
export ANDROID_HOME=/home/sanjay/Android/Sdk
export PATH=$PATH:/home/sanjay/Android/Sdk/tools
export PATH=$PATH:/home/sanjay/Android/Sdk/platform-tools
But still the error "environment variable is not set", "It should be set to SDK home directory" pops up every time I try to build an app.
Please help to resolve this issue..
Remove the spaces betwen the path and ANDROID_HOME in this line:
export ANDROID_HOME = /home/sanjay/Android/Sdk
such that it reads:
export ANDROID_HOME=/home/sanjay/Android/Sdk
It is not that difficult but you got to make your project make know weatabouts of your SDK.
Try following in your terminal
temporary option: In terminal root of your project
export ANDROID_HOME=[sdk location]
gradle build
===================================
adding path permanent:
Linux - ~/.bashrrc
export ANDROID_HOME=[sdd location]
export PATH=$ANDROID_HOME:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/baby/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
#PATH to my android
export ANDROID_HOME=/Users/baby/ADT/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
# Uncomment the following line to use case-sensitive completion.
# CASE_SENSITIVE="true"
# Uncomment the following line to use hyphen-insensitive completion. Case
# sensitive completion must be off. _ and - will be interchangeable.
# HYPHEN_INSENSITIVE="true"
# Uncomment the following line to disable bi-weekly auto-update checks.
# DISABLE_AUTO_UPDATE="true"
# Uncomment the following line to change how often to auto-update (in days).
# export UPDATE_ZSH_DAYS=13
# Uncomment the following line to disable colors in ls.
# DISABLE_LS_COLORS="true"
# Uncomment the following line to disable auto-setting terminal title.
# DISABLE_AUTO_TITLE="true"
# Uncomment the following line to enable command auto-correction.
# ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion.
# COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files
# under VCS as dirty. This makes repository status check for large repositories
# much, much faster.
# DISABLE_UNTRACKED_FILES_DIRTY="true"
# Uncomment the following line if you want to change the command execution time
# stamp shown in the history command output.
# The optional three formats: "mm/dd/yyyy"|"dd.mm.yyyy"|"yyyy-mm-dd"
# HIST_STAMPS="mm/dd/yyyy"
# Would you like to use another custom folder than $ZSH/custom?
# ZSH_CUSTOM=/path/to/new-custom-folder
# Which plugins would you like to load? (plugins can be found in ~/.oh-my-zsh/plugins/*)
# Custom plugins may be added to ~/.oh-my-zsh/custom/plugins/
# Example format: plugins=(rails git textmate ruby lighthouse)
# Add wisely, as too many plugins slow down shell startup.
plugins=(git)
# User configuration
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
# export MANPATH="/usr/local/man:$MANPATH"
source $ZSH/oh-my-zsh.sh
# You may need to manually set your language environment
# export LANG=en_US.UTF-8
# Preferred editor for local and remote sessions
# if [[ -n $SSH_CONNECTION ]]; then
# export EDITOR='vim'
# else
# export EDITOR='mvim'
# fi
# Compilation flags
# export ARCHFLAGS="-arch x86_64"
# ssh
# export SSH_KEY_PATH="~/.ssh/dsa_id"
# Set personal aliases, overriding those provided by oh-my-zsh libs,
# plugins, and themes. Aliases can be placed here, though oh-my-zsh
# users are encouraged to define aliases within the ZSH_CUSTOM folder.
# For a full list of active aliases, run `alias`.
#
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
Why does my $PATH show this?
zsh:no such file or
directory:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I use zsh and I have added this in .zshrc:
export ANDROID_HOME=/Users/baby/ADT/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
How should my environment variables be set in zsh to use Android SDK in OSX EL Capitan?
I have the following in my .zshrc file
export ANDROID_HOME=/usr/local/opt/android-sdk
path=("${ANDROID_HOME}/platform-tools:${ANDROID_HOME}/tools" $path)
The value of ANDROID_HOME will depend on your personal setup. I used Homebrew - The missing package manager for OS X to install the android-sdk:
brew install android-sdk
See also: Adding a new entry to the PATH variable in ZSH
Here's what I had to list in my .zshrc:
export ANDROID_HOME=~/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/tools/bin:$ANDROID_HOME/platform-tools
I needed to add ANDROID_SDK_ROOT for legacy support in my project.
My final goal is to be able to profile native code (C++) in android environments using gperftools.
My environment/Tools:
ubuntu 14.04
crystax-ndk-10.2.1
gcc-4.8.4
gperftools-2.4
(1)
I followed through this to make a standalone toolchain for later use:
Cross compiling for arm using crystax NDK
command:
./build/tools/make-standalone-toolchain.sh --system=linux-x86_64 --toolchain=arm-linux-androideabi-4.8 --platform=android-8 --install-dir=$HOME/my-android-toolchain
(2)
Thankfully, I found a script that will simplify the ./configure work:
https://gist.github.com/nddrylliog/4688209
and just modified it a bit (put in gperftools-2.4 folder):
#!/bin/sh
export DEV_PREFIX=$HOME
export ANDROID_NDK=${DEV_PREFIX}/crystax-ndk-10.2.1/
export CROSS_COMPILE=arm-linux-androideabi
export ANDROID_PREFIX=$HOME/my-android-toolchain
export SYSROOT=${ANDROID_NDK}/platforms/android-8/arch-arm
export CROSS_PATH=${ANDROID_PREFIX}/bin/${CROSS_COMPILE}
export CPP=${CROSS_PATH}-cpp
export AR=${CROSS_PATH}-ar
export AS=${CROSS_PATH}-as
export NM=${CROSS_PATH}-nm
export CC=${CROSS_PATH}-gcc
export CXX=${CROSS_PATH}-g++
export LD=${CROSS_PATH}-ld
export RANLIB=${CROSS_PATH}-ranlib
# export PREFIX=${DEV_PREFIX}/android/prefix
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include -I${DEV_PREFIX}/android/bionic"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib"
./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} "$#"
(3)
And then I actually do the ./configure and make install:
I put this script in gperftools-2.4 folder and run it:
cd gperftools-2.4
./android_configure.sh --enable-frame-pointers --prefix=$(pwd)
sudo make && make install
cd ..
Result:
The above gives me this error:
src/static_vars.cc: In function 'void tcmalloc::SetupAtForkLocksHandler()':
src/static_vars.cc:119:39: error: 'pthread_atfork' was not declared in this scope
CentralCacheUnlockAll); // child calls after fork
I would appreciate if anyone could leave me some advice on this.
Extra:
I know there is a android-ndk-profiler but since I use CMake for the cross-compilation and I'm not quite sure how to mess with the Android.mk so at the moment I will try to use gperftools which works fine in linux build.
This is because pthread_atfork appeared in Android libc (Bionic) only from Android 5.0. In CrystaX NDK, not all API are replaced by libcrystax, in particular, all pthread_xxx API reside in libc. So the only way as of now to do what you want is either use android-21 as minimal platform, or modify gperftools sources, avoiding usage of pthread_atfork.
BTW, we're working on moving all pthread_xxx API into libcrystax, so I expect all such API will be available soon even for earlier Android versions.
I am new to ionic framework. I am trying to start a ionic project. I install cordova and when I'm going to add the android platform to the project using 'ionic platform android' it gives me this error.
an error occurred while listing android targets
I also set the path to android sdk and ant by adding following lines to my .bashrc file
export ANDROID_HOME="$HOME/android-bundle/sdk/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-bundle/sdk/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
export ANT_HOME="$HOME/ant"
export PATH="$PATH:$ANT_HOME/bin"
But still I get the above error. Any kind of help would be appreciated.
try this in you .bashrc file.
export ANT_HOME="/usr/bin/ant"
export PATH="$PATH:$ANT_HOME/bin"
export HOME="/home/username"
export ANDROID_HOME="$HOME/android-bundle/sdk/tools"
export ANDROID_PLATFORM_TOOLS="$HOME/android-bundle/sdk/platform-tools"
export PATH="$ANDROID_HOME:$ANDROID_PLATFORM_TOOLS:$PATH"
I always explicitly define the paths globally.
Mine looks a little like this - from the terminal I type:
export PATH=${PATH}:~/dev/adt-bundle-linux-x86_64-20140321/sdk/tools
export PATH=${PATH}:~/dev/adt-bundle-linux-x86_64-20140321/sdk/platform-tools
If this doesn't work, try updating the sdk
type in your linux terminal:
export PATH=$PATH:/usr/lib/android-sdk-linux
export PATH=$PATH:/usr/lib/android-sdk-linux/tools
export PATH=$PATH:/usr/lib/android-sdk-linux/platform-tools