android Ubuntu adb: cannot execute binary file: 可执行文件格式错误

android Ubuntu adb: cannot execute binary file: 可执行文件格式错误

最近闲暇时 在window下 装了个Ubuntu 15.10 过程还算顺利,最后安装android 开发环境后 ,发现adb命令不能用 错误见标题。

原因:
我安装Ubuntu 系统是32位的 ,但是android sdk 下载的 platform-tools是64位的,导致adb命令无法执行 android studio 无法成功连接设备 。启动Android Device Monitor 报错 Unable to detect adb version, adb output: /opt/android-sdk-linux/platform-tools/adb: 1: /opt/android-sdk-linux/platform-tools/adb: Syntax error: “)” unexpected

看图
这是我通过sdk Manager 下载的 platform-tools
android Ubuntu adb: cannot execute binary file: 可执行文件格式错误_第1张图片

我是通过lib64这个文件区分的

解决办法 重新下载一份 platform-tools 放到对应的 目录下,使用SDK Manger更新是不行的。

下载:
android Ubuntu adb: cannot execute binary file: 可执行文件格式错误_第2张图片
我下载的是 platform-tools_r23-linux.zip 这个
提取后:
android Ubuntu adb: cannot execute binary file: 可执行文件格式错误_第3张图片
放在sdk下
android Ubuntu adb: cannot execute binary file: 可执行文件格式错误_第4张图片

成功

你可能感兴趣的:(android)