./fastboot: No such file or directory - android

I've struggled with this for awhile! I'm beating my head against the wall.
I am trying to run fastboot (android-linux-tools/platform-tools/fastboot) and I am getting a No such file or directory message.
I am on ubuntu 12.04 x64. I am not new to linux, I'm baffled.
$ cd ~/android-sdk-linux/platform-tools
$ ./fastboot
-bash: ./fastboot: No such file or directory
$ ./adb devices
-bash: ./adb: No such file or directory
$ ls -la
...
-rwxrwxr-x 1 nick nick 159644 Apr 16 21:10 adb
...
-rwxrwxr-x 1 nick nick 149928 Aug 16 21:10 fastboot
...

Is this a new machine where you have just downloaded the SDK? Since you are running a 64-bit distribution, check whether you have installed the ia32-libs package needed for the SDK executables to work:
sudo apt-get install ia32-libs

Try with su.
I had the same problem with .android directory and even with the ls command I could not see it(even after su). After su I could cd in the directory

Related

tinyalsa sh: ./tinypcminfo: No such file or directory

tinyalsa elf failed to run on android shell, anybody know what is wrong with it ?
I am new to android, :-)
here are my steps:
1. download tinyalsa source code to a ubuntu 10 vm, compile it with arm-linux-gnueabi-gcc
2. adb push xx\tinypcminfo /data/local/tmp
3. adb shell -> cd /data/local/tmp ->chmod 777 tinypcminfo
4. ./tinypcminfo
5. error happened

Android SDK path issue when using calabash-android

I'm getting a "Could not find an Android SDK please make sure it is installed" error when trying to run calabash-android commands. I've installed the Android SDK via brew. Here are the contents of my .bash_profile:
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.2
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
PATH=$PATH:$ANDROID_HOME/build-tools
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
PATH=$PATH:/usr/local/apache-ant-1.9.4/bin
PATH=$PATH:/usr/local/share/npm/bin
JAVA_HOME=/usr/libexec/java_home
export PATH
Here's my $PATH:
echo $PATH
/Users/mchumak/.rvm/gems/ruby-2.1.1/bin:/Users/mchumak/.rvm/gems/ruby-2.1.1#global/bin:/Users/mchumak/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/android-sdk/24.2/tools:/usr/local/Cellar/android-sdk/24.2/platform-tools:/usr/local/Cellar/android-sdk/24.2/build-tools:/Users/mchumak/.rvm/bin:/Users/mchumak/.rvm/bin:/opt/local/bin:/opt/local/sbin:/Users/mchumak/.rvm/bin:/usr/local/apache-ant-1.9.4/bin:/usr/local/share/npm/bin
"which android" produces:
/usr/local/bin/android
The contents of that particular file are:
#!/bin/bash
TOOL="/usr/local/Cellar/android-sdk/24.2/tools/android"
exec "$TOOL" "$#"
I can run the Android SDK Manager from the command line just fine, and it shows the correct SDK path (/usr/local/Cellar/android-sdk/24.2).
I'm stumped. Any ideas why calabash-android can't find the SDK?
This will fix your issue,
echo "export PATH=$PATH:/Users/#username/Library/Android/sdk/platform-tools/sdk/platform-tools/" >> ~/.bash_profile
install android-platform-tools -> brew install android-platform-tools
- Also ensure yourself have admin rights
Looking at your $PATH output seems like android sdk path isnt loaded into PATH. Add below to your .bash_profile
PATH=$PATH:$ANDROID_HOME
calabash-android run /Users/marcg/Downloads/app-news.apk
I received that following error
Could not find any platform directory in '/Users/marcg/Library/Android/sdk/platforms'
I corrected this with the symlink below:
/Users/marcg/Library/Android/sdk/platforms
platforms$ ln -s ../platform-tools/ platform
I ran again and get an error that the android jar was missing from a standard directory of /Users/marcg/Library/Android/sdk/platforms
I then copied that android.jar to this platforms dir
Dir now looks like:
/Users/marcg/Library/Android/sdk/platforms
us164912:platforms marcg$ ls -l
total 49640
-rwxr-xr-x 1 marcg Users 25409822 Oct 5 09:26 android.jar
lrwxr-xr-x 1 marcg Users 18 Oct 5 09:14 platform -> ../platform-tools/
Still getting
Did not find 'android.jar' in any standard directory of '/Users/marcg/Library/Android/sdk/platforms'. Calabash will therefore take longer to load
I copied the android.jar to the platform-tools directory and remaining error went away.
Steps to correct:
Make a symlink in platforms that points to platform-tools
ln -s ../platform-tools/ platform
Copy the android.jar to the platform-tools dir
Would be better if the framework allowed you configure via file or additional env vars where to find each of these. My earlier attempt to set ANDROID_HOME to the platform-tools dir didn't work and why I did a symlink.

Android NDK Installation on ubuntu

I downloaded the latest ndk from http://developer.android.com/tools/sdk/ndk/index.html#Installing.
For installing the ndk i used the following command in the terminal.
chmod a+x android-ndk-r10c-darwin-x86_64.bin
It returned saying chmod: cannot access `android-ndk-r10c-darwin-x86_64.bin': No such file or directory
Please help!
It's android-ndk-r10d-linux-x86_64.bin. if you are using ubuntu 64 bit version, you should download linux-x86_64.bin one. darwin is for Mac OS X, if you have downloaded the right file, use this command
chmod a+x android-ndk-r10d-linux-x86_64.bin
Please set Path on Command android-ndk-r10c-darwin-x86_64.bin is placed
and run this line like:
C:\User\folder Name of android-ndk-r10c-darwin-x86_64.bin placed\
chmod a+x android-ndk-r10c-darwin-x86_64.bin

Error libGL.so: cannot open shared object file using Android emulator

I was trying to run android emulator in Ubuntu 12.04(64-bit). But, I got the following errors.
Starting emulator for AVD 'emulatr'
Failed to load libGL.so
error libGL.so: cannot open shared object file: No such file or directory
Failed to load libGL.so
error libGL.so: cannot open shared object file: No such file or directory
emulator: emulator window was out of view and was recentered
After using locate libGL. I found
/home/adnan/android-sdk-linux/tools/lib/libGL.so
/usr/lib/libGL.so
/usr/lib/i386-linux-gnu/libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so
/usr/lib/i386-linux-gnu/mesa/libGL.so.1
/usr/lib/i386-linux-gnu/mesa/libGL.so.1.2.0
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1
/usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0
I also tried some solution from this question But, didn't work. I will be glad, if you guys help to solve this problem.
http://learnedstuffs.wordpress.com/2012/07/17/fixing-ubuntu-error-failed-to-load-libgl-so/
apt-get install libgl1-mesa-dev
worked for me
On Fedora
sudo yum install mesa-libGL-devel
As I'm using 64-bit Ubuntu 12.04. So, I did this
$ sudo apt-get install git-core gnupg flex bison gperf build-essential \
zip curl libc6-dev libncurses5-dev:i386 x11proto-core-dev \
libx11-dev:i386 libreadline6-dev:i386 libgl1-mesa-glx:i386 \
libgl1-mesa-dev g++-multilib mingw32 openjdk-6-jdk tofrodos \
python-markdown libxml2-utils xsltproc zlib1g-dev:i386
$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so
This works for me on Ubuntu 14.04 64-bit:
$ sudo apt-get install libgl1-mesa-dri
$ sudo ln -sv /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/x86_64-linux-gnu/libGL.so
You don't need the development files for libgl1-mesa, so instead you should/could install libgl1-mesa-dri instead of libgl1-mesa-dev as suggested by others.
This saves you a couple of MB of unnecessary files.
Furthermore, the Android applications are either 32 bit or 64 bit.
For a or a 32 bit Ubuntu you require the 32 bit SDK (as 64 bit does not work):
sudo apt-get install libgl1-mesa-dri
Same goes for a 64-bit Ubuntu with a 64-bit SDK.
But for a 64 bit Ubuntu in combination with a 32 bit SDK, you need to specify that you require the 32 bit version of the package:
sudo apt-get install libgl1-mesa-dri:i386
I too had this problem (fedora 20), but the libGL files already existed on my filesystem. Based on an examination of the libraries on an older fedora 18 installation, I found that I could resolve the problem by providing a symbolic link for libGL.so linking to libGL.so.1.2.0.

How to run BASH script in my Android?

My same BASH script is working in Fedora/CentOS.
But I am testing one Android eee pad transformer.
Where i have terminal access and i wrote a small test script. But its not working, how can i fix it? what am i doing wrong?
/data/data/berserker.android.apps.sshdroid/home $ cat test.sh
#!/bin/bash
var=`ifconfig -a`;
echo $var;
/data/data/berserker.android.apps.sshdroid/home $ chmod +x test.sh
/data/data/berserker.android.apps.sshdroid/home $ ./test.sh
sh: ./test.sh: not found
/data/data/berserker.android.apps.sshdroid/home $ uname -a
Linux localhost 2.6.36.3-00004-g069b8b5 #1 SMP PREEMPT Wed May 11 22:14:22 CST 2011 armv7l GNU/Linux
/data/data/berserker.android.apps.sshdroid/home $ bash ./test.sh
sh: bash: Permission denied
/data/data/berserker.android.apps.sshdroid/home $ ls -l /bin/bash
ls: /bin/bash: No such file or directory
/data/data/berserker.android.apps.sshdroid/home $ find / -name "bash"
find: /config: Permission denied
lots more.......
find: /proc/595/task/598/fd: Permission denied
......
find: /data: Permission denied
find: /root: Permission denied
Follow up:
This is my script now which works:
#!/bin/sh
echo "hello wassup, run me simply as './test.sh'";
or
#!/bin/bash
echo "hello wassup, run me using 'sh ./test.sh'";
in Android the shell is located in /system/bin/sh not /bin/sh like it is on most Unix-like systems. So even if you change #!/bin/bash to #!/bin/sh it will still not work. you'll have to use #!/system/bin/sh
Android is not a GNU/Linux distribution so you can't expect that all scripts that run on GNU/Linux to also work on Android.
May be it will work when calling interpreter with a script?
$ bash ./test.sh
I saw, that although it is specified #!/bin/bash error was posted by sh - may be it do wrong.
UPD
$ sh ./test.sh
Most Android devices don't have a bash interpreter installed. If you really need to run the script across Linux and Android, you could try using BusyBox but that will require rooting your device (and potentially voiding your warranty). Even then though, I don't know if the ifconfig utility is included in BusyBox.
I would strongly recommend using the Android SDK to write an app to do whatever your trying to accomplish.
As was stated, the Android OS (up to and including 4.0) does not include the BASH interpreter (just shell). While BusyBox is a great tool, I believe it's only a single executable that combines stripped-down-functionality-for-size versions of common UNIX utilities, but doesn't actually include the BASH interpreter.
For an Android compiled version of the BASH interpreter, refer to this Forum thread:
http://forum.xda-developers.com/showthread.php?t=537827
You can install Busybox, which provides you with many utilities such as awk, file, etc... and Terminal Emulator.
Create a shell file with #!/system/bin/sh as the first line (shebang)
Now place the completed script under /system/xbin or /system/bin and run it from the Terminal Emulator
The information is an excerpt from this article : HOW TO RUN SHELL SCRIPTS ON ANDROID DEVICES

Categories

Resources