简体   繁体   English

Android Studio adb on Ubuntu

[英]Android Studio adb on Ubuntu

I try to connect the device from USB to Wifi but the command prompt tells me all the time that adb is not found.我尝试将设备从 USB 连接到 Wifi,但命令提示符一直告诉我找不到 adb。

But it is definitly inside my folder: "~/Android/Sdk/platform-tools" it contain:但它肯定在我的文件夹中:“~/Android/Sdk/platform-tools”它包含:

adb          e2fsdroid  hprof-conv  mke2fs       package.xml        sqlite3
api          etc1tool   lib64       mke2fs.conf  sload_f2fs         systrace
dmtracedump  fastboot   make_f2fs   NOTICE.txt   source.properties

I start with我从

adb tcpip 5555

Here I get the error message.在这里我收到错误消息。 What I do wrong here?我在这里做错了什么?

Your shell doesn't know where to look when you call adb that's why you need to specify it.当您调用adb时,您的 shell 不知道在哪里看,这就是您需要指定它的原因。

First check which shell you're using by calling echo $SHELL - the usual ones on Linux are bash and zsh.首先通过调用echo $SHELL检查您使用的是哪个 shell - Linux 上的常见的是 bash 和 zsh。 For Bash the config file is in ~/.bash_profile , for zsh it's in ~/.zshrc .对于 Bash,配置文件在~/.bash_profile中,对于 zsh,它在~/.zshrc中。

Depending on what shell you're using open that file and add this line into it:根据您使用的 shell 打开该文件并将此行添加到其中:

export PATH=${PATH}:$HOME/Android/Sdk/platform-tools/

And restart the shell.并重启 shell。

Then you can check that you the adb location is recognized with:然后您可以检查您的adb位置是否被识别:

adb --version

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM