0

I'm trying to run the android emulator for my React Native project from Powershell. It seems I didn't install something correctly. From inside my React Native project I use npm start and the project runs, then I use a for Android and I get this: "Error running adb: No Android device found. Please connect a device and follow the instructions here to enable USB debugging: https://developer.android.com/studio/run/device.html#developer-device-options. If you are using Genymotion go to Settings -> ADB, select "Use custom Android SDK tools", and point it at your Android SDK directory."

I am not using Genymotion. I do not want to use USB debugging, I want to run an emulator on my desktop. Is this something that's possible?

edit

From Powershell:

cd env:
ls path
C:\AndroidSDK\platform-tools\adb.exe

So it would seem abd is on my path.

smilebomb
  • 3,883
  • 8
  • 36
  • 71
  • what emulator you used to run react native? – flix Aug 07 '18 at 02:17
  • @flix I am using android studio. – smilebomb Aug 07 '18 at 02:18
  • I'm not experience with AVD, but you should make sure `adb devices` showing at least 1 connected device, I'm using `Nox emulator` to run react native and I can connect `Nox` using `adb connect 127.0.0.1:62001` – flix Aug 07 '18 at 02:22
  • Do I need to install `abd`? `adb : The term 'adb' is not recognized as the name of a cmdlet, function, script file, or operable program.` – smilebomb Aug 07 '18 at 02:23
  • it must existing in `/path-to-your-sdk/platform-tools` add `adb` to your `environment variables path system` – flix Aug 07 '18 at 02:25
  • https://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows – Martin Zeitler Aug 07 '18 at 02:36
  • @flix Please see my edit. – smilebomb Aug 07 '18 at 02:40
  • @MartinZeitler Please see my edit. – smilebomb Aug 07 '18 at 02:40
  • @smilebomb you need to add the paths (the SDK has two paths with binary executables), not the filename... as the variable name `%PATH%` might suggest. – Martin Zeitler Aug 07 '18 at 02:41
  • the main Issue is your device (emulator) not connected with adb, i suggest to used your phone and check if `adb devices` detected your phone, – flix Aug 07 '18 at 02:43
  • @MartinZeitler I've updated my environment variable to use `C:\AndroidSDK\platform-tools\` instead of the filename and restarted. The issue persists. – smilebomb Aug 07 '18 at 02:48
  • @smilebomb you might need to create an `AVD` android virtual device, so that the emu has an image to run... https://developer.android.com/studio/run/managing-avds (it obviously cannot find any device, while there is not even a virtual one) – Martin Zeitler Aug 07 '18 at 02:51
  • @flix `adb devices` says no devices are attached. How can I resolve this? – smilebomb Aug 07 '18 at 03:29
  • makes sure `usb debugging` is enable, and the pop up will appear, just press `ok` then run `adb devices`, adb should detect your phone – flix Aug 07 '18 at 03:32

1 Answers1

0

I'm coming from a Mac development environment, where pressing i after npm start automatically opens the Simulator app. This is not the same behavior on Windows. You first need to open Android Studio and launch an emulator, then the a command will work.

You can check if there's a device ready to run expo with adb devices. My list was empty until I started an emulator.

smilebomb
  • 3,883
  • 8
  • 36
  • 71