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 的版本
相关推荐
深念Y1 分钟前
技术探索记录 在 Android 手机上运行 One API
android·linux·服务器·智能手机·go·交叉编译·服务
summerkissyou198710 小时前
Android - 摄像头 - hal - 开发教程,例子,常见问题,分析方法,解决方案
android
summerkissyou198711 小时前
Android 16 架构图
android
神龙天舞200111 小时前
MySQL 备库为什么会延迟好几个小时
android·数据库·mysql
海天鹰11 小时前
Android Studio Quail3 | 2026.1.3 升级后 Gradle 报错
android studio
码农coding14 小时前
android12 systemUI 之锁屏
android
圆山猫15 小时前
[Virtualization](三):RISC-V H-extension 与 Guest 执行模式
android·java·risc-v
爱笑鱼15 小时前
Binder(七):getCallingUid() 读到的是谁?clearCallingIdentity() 又清掉了什么?
android
2501_9159090621 小时前
iOS 应用反调试技详解术 检测调试器的原理与防护实践
android·ios·小程序·https·uni-app·iphone·webview
Lvan的前端笔记21 小时前
AndroidX 完全入门指南
android·androidx