你如何将你的终端与安卓模拟器连接起来

How do you connect your terminal with the Android emulator(你如何将你的终端与安卓模拟器连接起来)
本文介绍了你如何将你的终端与安卓模拟器连接起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经尝试导航到 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.

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

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

How to target newer versions in .gitlab-ci.yml using auto devops (java 11 instead of 8 and Android 31 instead of 29)(如何在.gitlab-ci.yml中使用自动开发工具(Java 11而不是8,Android 31而不是29)瞄准较新的版本)
Android + coreLibraryDesugaring: which Java 11 APIs can I expect to work?(Android+core LibraryDesugering:我可以期待哪些Java 11API能够工作?)
How to render something in an if statement React Native(如何在If语句中呈现某些内容Reaction Native)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Using Firebase Firestore in offline only mode(在仅脱机模式下使用Firebase FiRestore)
Crash on Google Play Pre-Launch Report: java.lang.NoSuchMethodError(Google Play发布前崩溃报告:java.lang.NoSuchMethodError)