Ubuntu 18.04.6 Android Studio Giraffe adb logcat 无法使用

在 Ubuntu 18.04.6 上

在链接上设备以后,发现可以用 Android Studio 安装应用

但无法用 Android Studio 看 logcat

手动从命令行停止,启动 adb 会报错如下:

bash 复制代码
daemon not running.    
starting it now on port 5037    
ADB server didn't ACK   
failed to start daemon  
error: cannot connect to daemon

Android Studio 下面 logcat 标签页,设备选择框显示 "no connected devices",但却可以正常安装 app,就是没 log。

我这里的错误原因是因为之前用 sudo apt-get install adb 安装过 adb

adb 版本太低导致的。

建议通过 update-alternatives 使用 android studio 里面 Tools -> sdk manager -> SDK Tools -> Android SDK Platform-Tools 的最新版

然后操作一下 update-alternatives,使用新版的,再重启 Android Studio 即可。

bash 复制代码
sudo update-alternatives --install /usr/bin/adb adb /usr/lib/android-sdk/platform-tools/adb 1000
sudo update-alternatives --install /usr/bin/adb adb /home/xxx/Android/Sdk/platform-tools/adb 2000
sudo update-alternatives --config adb
# 然后选择优先级为 2000 的版本
相关推荐
mmsx3 分钟前
Android 手簿 ADB 无线调试全攻略:USB 转 WiFi 一键连接
android·前端
律宏阔35 分钟前
Android WebRTC + H.265 适配记录
android
mmsx42 分钟前
MapLibre 实战 08|GPS 点漂了几百米才被发现:GCJ-02 纠偏原理与"转两次"陷阱
android·前端
春夏与冬42 分钟前
Android : apktool
android
YF021144 分钟前
如何验证App预置为特权App功能正常?
android
律宏阔1 小时前
两台 Android 开发板的硬件序列号完全相同,如何使用 ADB 连接其中的一台?
android
律宏阔1 小时前
用 KSP + Hilt 自动注入 Android ViewBinding
android
AI2中文网2 小时前
Ai2 Starter 新版上线:Android 15、Hyper-V 与更快的模拟器体验
android
挂科边缘2 小时前
Android Studio 保姆级安装教程,Windows 电脑上安装 Android Studio
android·windows·android studio
Danny_姜3 小时前
Android Studio Quail 4 稳定版发布:本地 Gemma 4 + Android Skills
android·ide·android studio