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 的版本
相关推荐
2501_916008891 小时前
全面介绍Fiddler、Wireshark、HttpWatch、SmartSniff和firebug抓包工具功能与使用
android·ios·小程序·https·uni-app·iphone·webview
玉梅小洋2 小时前
Windows 10 Android 构建配置指南
android·windows
Libraeking4 小时前
视觉篇:Canvas 自定义绘图与高级动画的华丽圆舞曲
android·经验分享·android jetpack
Fushize4 小时前
多模块架构下的依赖治理:如何避免 Gradle 依赖地狱
android·架构·kotlin
Jomurphys5 小时前
Kotlin - 类型别名 typealias
android·kotlin
Haha_bj5 小时前
Flutter ——flutter_screenutil 屏幕适配
android·ios
Haha_bj5 小时前
Flutter ——device_info_plus详解
android·flutter·ios
前端小伙计6 小时前
Android/Flutter 项目统一构建配置最佳实践
android·flutter
Mr_sun.7 小时前
Day09——入退管理-入住-2
android·java·开发语言
ujainu8 小时前
告别杂乱!Flutter + OpenHarmony 鸿蒙记事本的标签与分类管理(三)
android·flutter·openharmony