How to connect a terminal to an Android emulator

I tried to go to the android tool folder and enter the command "adb shell", but it does not work. My terminal seems to only recognize the adb part of the command and gives me an error message. What am I doing wrong?

+7
source share
1 answer
  • List all connected devices by typing adb devices

    Check if there are any listed devices. If not, you can check that your device is connected and / or your emulator is working.

  • If this works, and you have, for example, your emulator is working and your USB device is connected:

    adb -d shell for connecting to a USB device.
    adb -e shell to connect to the emulated device.

    If you have several emulators or USB devices that you might want to use: adb -s <DEVICE> shell

Note : Make sure the path to android-sdk is configured correctly in your environment. To run checkcheck, run the shell and enter adb version . If this command succeeds, you are configured. If not, add /path/to/android-sdk/tools and /path/to/android/platform-tools to your $PATH env variable. In windows, android sdk is usually located in C:\Users\<username>\AppData\Local\Android\sdk .

+19
source

All Articles