I am trying to run the emulator -list-avds via terminal, but for some reason keep on getting this error.
Here is my .zshrc profile:
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin" # Added by n-install (see http://git.io/n-in$
# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"
export PATH=$PATH:/~nativeGuy/Library/Android/sdk
export PATH=$PATH:/~nativeGuy/Library/Android/sdk/platform-tools
export ANDROID_HOME=$HOME/Library/Android/sdk
You could do a
that_guys_home_dir=~nativeGuy # Do tilde-expansion
PATH=$PATH:$that_guys_home_dir/Library/Android/sdk
This allows you to put other people's home directory into the path. Of course, if you happen to be nativeGuy, you would simpler do a
PATH=$PATH:$HOME/Library/Android/sdk
Since you are using zsh, a more elegant solution, which obviates you from worrying about the correct way of doing tilde expansion, would be to do a
path+=~nativeGuy/Library/Android/sdk
This implicitly sets PATH, because path and PATH are kept in-sync.
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.
how can i fix this problem ? when i using dryrun. log is here.
➜ ~ dryrun git#github.com:cesarferreira/android-helloworld.git
Searching for devices...
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:211:in
spawn': No such file or directory - /platform-tools/adb
(Errno::ENOENT) from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:211:in
popen_run' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/open3.rb:99:in
popen3' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun/dryrun_utils.rb:50:in
run' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun/dryrun_utils.rb:46:in
run_adb' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun.rb:108:inpick_device' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/lib/dryrun.rb:171:in call' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/gems/2.0.0/gems/dryrun-0.8.1/bin/dryrun:5:in
' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/bin/dryrun:23:in load' from
/Users/baidu/.rvm/rubies/ruby-2.0.0-p643/bin/dryrun:23:in'
The problem you're receiving is dryrun not being able to recognize an adb path. The adb path needs to be set to ANDROID_HOME, for dryrun to work.
Steps to Fix this:
echo export "ANDROID_HOME=/Users/yourName/Library/Android/sdk" >> ~/.bash_profile
source ~/.bash_profile
echo $ANDROID_HOME
Test dryrun git#github.com:cesarferreira/android-helloworld.git 🎉
From the documentation:
ANDROID_HOME needs to be set with the adb path.
Open the file ~/.bash_profile (~/.zshenv if you are using Zsh) or create it if it does not exist, and add the following (with your real Android SDK path):
export ANDROID_HOME=/Users/{your_user}/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
You need to set your ANDROID_HOME
I'm facing the problem, that i cannot set the ANDROID_HOME path variable.
I added the following lines to my bashrc file:
# Android Path
export ANDROID_HOME=~/android-sdk/Sdk/tools
But when i try to access android via the terminal i get this error:
android: command not found
How can i solve this problem?
You need to add the variable in your PATH as well. The aim is for your PATH variable to contain the complete folder path, in which the file 'android' is present.
export ANDROID_HOME=~/android-sdk/Sdk/tools
export PATH=$ANDROID_HOME:$PATH
Don't forget to source your bashrc after adding these lines
source ~/.bashrc
Again, the file 'android' should be present in the tools folder.
Follow the following steps:
1)Open the bashrc file from command line
nano ~/.bashrc
2) Add following lines at the top.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
3)Now, quit terminal and re-launch, and try typing:
adb -h
android -h
If both commands are giving you output, it means everything works fine.
I am trying to import some third party module like pygoogle in my app when i run app in computer using kivy it works fine but when i make apk using buildozer it crashes every time then i find that i have to go in python-for-android and run this command to include module ./distribute.sh -m "pil ffmpeg kivy" but i still get error that
root#kali:~# cd ~/.buildozer/android/platform/python-for-android
root#kali:~/.buildozer/android/platform/python-for-android# ls
COPYING dist docs README.rst src
cythonizer.py distribute.sh LICENSE recipes tools
root#kali:~/.buildozer/android/platform/python-for-android# ./distribute.sh -m "pil ffmpeg kivy"
Check build dependencies for Kali
Avoid check build dependencies, unknow platform Kali
Check environment
No ANDROIDSDK environment set, abort
root#kali:~/.buildozer/android/platform/python-for-android#
I am using KAli Linux and please solve this someone ...it will be very helpfull to me
Try pasting the pygoogle folder in your app's directory, at the same level as main.py. Also, from the error, it looks like you need to set the ANDROIDSDK environment variable. See the docs.
I had a similar problem, and simply setting the ANDROIDSDK environment variable didn't sort it, but the following did.
Try the following and then run the ./distribute.sh -m "pil ffmpeg kivy" command from the same terminal(as the environment vars will only have been set for that terminal and any child processes), or alternatively, add these lines to your ~/.bashrc file for them to be permanent:
export ANDROIDSDK=/path/to/android-sdk
export ANDROIDNDK=/path/to/android-ndk
export ANDROIDNDKVER=rX
export ANDROIDAPI=X
# example
export ANDROIDSDK="/home/tito/code/android/android-sdk-linux_86"
export ANDROIDNDK="/home/tito/code/android/android-ndk-r7"
export ANDROIDNDKVER=r7
export ANDROIDAPI=14
Examples taken from here. I recommend having a look.
I am facing issues in building the android kernel. I tried the following steps from the following link ( http://source.android.com/source/building-kernels.html )
I donot have the AOSP. I am just trying to compile the kernel
Source: git clone https://android.googlesource.com/kernel/goldfish.git
I placed the tool chain in the following directory
/home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin
I set the path as follows
export PATH=$(pwd)/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin:$PATH
pwd: /home/chid/goldfish
set the environment variables as follows.
export ARCH=x86
export SUBARCH=x86
export CROSS_COMPILE=i686-linux-android-
setup the config file as
make arch=x86 goldfish_defconfig
gave make as follows.
make -j6
But it tells me a "cannot find" error.
Error:
/home/chid/goldfish/scripts/gcc-version.sh: line 25: /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc: No such file or directory
Can you tell me what I am missing? I ensured that the above mentioned file is present and the path is set correctly. Is there something else I need to take care of?
You got the toolchain as the following?
$ git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6
Have you tried to launch gcc directly?
$ /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc
How about ldd?
$ ldd /home/chid/goldfish/prebuilts/gcc/linux-x86/x86/i686-linux-android-4.6/bin/i686-linux-android-gcc
In vagrant precise32 Ubuntu image, no problems at all.
$ ldd i686-linux-android-4.6/bin/i686-linux-android-gcc
linux-gate.so.1 => (0xb77c7000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xb7619000)
/lib/ld-linux.so.2 (0xb77c8000)
$ i686-linux-android-4.6/bin/i686-linux-android-gcc
i686-linux-android-gcc: fatal error: no input files
compilation terminated.
$ sh goldfish/scripts/gcc-version.sh i686-linux-android-4.6/bin/i686-linux-android-gcc
0406
You might need to have another Linux environment to execute gcc.