ubuntu15(32位),androidstudio1.5(android-studio-ide-141.2456560-linux.zip ),androidsdk24.4.1(android-sdk_r24.4.1-linux.tgz),JDK(jdk-8u65-linux-i586.tar.gz)
错误信息:
david@david-laptop:/opt/android-studio/bin$ adb
bash: /home/david/android-sdk-linux//platform-tools/adb: cannot execute binary file: 可执行文件格式错误
david@david-laptop:~/android-sdk-linux/platform-tools$ ./adb
bash: ./adb: cannot execute binary file: 可执行文件格式错误
环境变量:
JAVA_HOME=/usr/java/jdk_8u65
export JRE_HOME=/usr/java/jdk_8u65/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
if [ -d /home/david/android-sdk-linux/ ]; then
ANDROID_SDK_HOME=/home/david/android-sdk-linux/
PATH=${ANDROID_SDK_HOME}/platform-tools:${ANDROID_SDK_HOME}/tools:$PATH
fi
Can you post a screenshot of the variable configuration? (Method: Enter $PATH in Terminal), and then help you determine whether the environment variables are configured correctly.
Intuitively, your adb does not have execution permissions. You can empower it first, and you can empower the entire sdk.
Execute the command
chmod a+x ~/android-sdk_r24.4.1-linux.tgz
and then unzip
@chuyao
Hello, I unzipped to the /opt directory before, and then sudo mv to the home directory. At that time, I was thinking about whether there was a problem with the permissions. rm -rf directory, and re-unzipped to the home directory tar zxvf an.. -C /home/david, the problem remains the same, I confirmed that there is no problem with downloading the version
The result of $PATH is shown in the picture
Updated at 12:36:
david@david-laptop:~$rm -rf android-sdk-linux
david@david-laptop:~$chmod a+x ~/download/android-sdk_r24. 4.1-linux.tgz
david@david-laptop:~$tar zxvf ~/dwonload/an.. -C ~/
...
david@david-laptop:~/android-sdk- linux/platform-tools$ ./adb
bash: ./adb: cannot execute binary file: executable file format error