英文:
Which Android ADB should I keep on Ubuntu?
问题
我注意到运行adb version
在我的Ubuntu 22.04系统上显示了一个过时的版本28。我不确定之前如何安装的adb
,也许是通过android-sdk-platform-tools
包安装的?
Android Studio有一个更新的版本34的adb
。 Android Studio的系统设置> Android SDK显示Android SDK位置
为/home/gv/Android/Sdk
。
你的建议是如何修复adb
版本不匹配的问题?我主要使用Android Studio和adb
进行Flutter开发与Vscode。我不确定这些更改是否会影响在Vscode上进行Flutter开发。
有什么建议吗?谢谢。
英文:
I noticed that running adb version
show an outdated version 28 on my Ubunutu 22.04 system. I'm not sure how adb
was previously installed, maybe through the apt package android-sdk-platform-tools
?
$ which adb
/usr/bin/adb
$ adb version
Android Debug Bridge version 1.0.41
Version 28.0.2-debian
Installed as /usr/lib/android-sdk/platform-tools/adb
$ dpkg -l | grep android-sdk-platform
ii android-sdk-platform-tools 28.0.2+6 amd64 Tools for interacting with an Android platform
ii android-sdk-platform-tools-common 28.0.2+6 all Tools for interacting with an Android platform - Common files
Android Studio has a much newer version 34 of adb
. Android Studio's System Settings > Android SDK shows Android SDK Location
to be /home/gv/Android/Sdk
.
$ /home/gv/Android/Sdk/platform-tools/adb version
Android Debug Bridge version 1.0.41
Version 34.0.3-10161052
Installed as /home/gv/Android/Sdk/platform-tools/adb
Running on Linux 5.19.0-41-generic (x86_64)
What is your recommendation to fix this mismatch in adb
? I am mainly using Android Studio and adb
for Flutter development with Vscode. I am unsure if these changes can affect working on Flutter with Vscode.
Any suggestions? Thanks
答案1
得分: 1
你实际上需要前往你安装 SDK 的地方,
默认情况下,在 Ubuntu 22.04.3 LTS 上,如果你使用 sudo apt install
安装,
它会被放置在 /usr/lib/android-sdk/platform-tools/adb
!
你应该删除 platform-tools/
。
前往 Android 开发者页面
https://developer.android.com/studio/releases/platform-tools
下载最新版本的 platform-tools,并替换你的任何安装位置
在我的情况下是 /usr/lib/android-sdk/
> 解压缩它 > 重命名为 'platform-tools'
最终你会在 /usr/lib/android-sdk/platform-tools/
。
运行 sudo apt update
,一切正常!
$ adb version
Android Debug Bridge version 1.0.41 Version 34.0.4-10411341
Installed as /usr/lib/android-sdk/platform-tools/adb
Running on Linux 6.2.0-26-generic (x86_64)
英文:
You actually have to go to the place where you installed your sdk,
by default on ubuntu 22.04.3 LTS if you installed it with sudo apt install
,
is placed in /usr/lib/android-sdk/platform-tools/adb
!
you should delete platform-tools/
.
Go to android developer at
https://developer.android.com/studio/releases/platform-tools
download latest version of plateform-tools et replace it anywhere you have it
in my case /usr/lib/android-sdk/
> extract it > renaim it ' plateform-tools'
in final you have been /usr/lib/android-sdk/platform-tools/
.
sudo apt update
that's good !
$ adb version
Android Debug Bridge version 1.0.41 Version 34.0.4-10411341
Installed as /usr/lib/android-sdk/platform-tools/adb
Running on Linux 6.2.0-26-generic (x86_64)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论