你如何将你的终端与安卓模拟器连接起来 [英] How do you connect your terminal with the Android emulator

查看:38
本文介绍了你如何将你的终端与安卓模拟器连接起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试导航到 android 工具文件夹并输入adb shell"命令,但它似乎不起作用.我的终端似乎只识别命令的 adb 部分并给我一条错误消息.我做错了什么???

I have tried the navigate to the android tool folder and entering the "adb shell" command but it doesn't seem to work. My terminal seems only to recognize the adb part of the command and gives me an error message. What am I doing wrong???

推荐答案

  1. 通过键入 adb devices
  2. 列出所有连接的设备
  1. List all connected devices by typing adb devices

检查是否列出了任何设备.如果没有,您可能需要检查您的设备是否已连接和/或您的模拟器是否正在运行.

Check, if there are any devices listed. If not you may want to check that your device is connected and/or your emulator is running.

  1. 如果它有效,并且您的模拟器正在运行并且您的 USB 设备已连接使用:

  • adb shell 如果您只连接了设备.

    • adb shell if you only have device connected.

      adb -d shell 连接到 USB 设备.

      adb -d shell to connect to an USB-Device.

      adb -e shell 连接到模拟设备.

      如果您有多个模拟器或 USB 设备,您可能希望使用:adb -s 外壳

      If you have more than one emulator or usb devices you might want to use: adb -s <DEVICE> shell

      注意:确保在您的环境中正确设置了 android-sdk 的路径.要快速检查,启动 shell 并输入 adb version.如果该命令成功,您就设置好了.如果没有,请将 /path/to/android-sdk/tools/path/to/android/platform-tools 添加到您的 $PATH环境变量.在 Windows 上,android sdk 通常位于 C:Users<username>AppDataLocalAndroidsdk.

      Note: Make sure that the path to the android-sdk is properly set-up in your environment. To quickcheck, fire up a shell and type adb version. If that command succeeds, you're set up. If not, add /path/to/android-sdk/tools and /path/to/android/platform-tools to your $PATH env variable. On windows the android sdk is typically located in C:Users<username>AppDataLocalAndroidsdk.

      这篇关于你如何将你的终端与安卓模拟器连接起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆