28

Can I run android emulator without an android phone? I have installed android studio and I've already installed android virtual device. However, when I try to run it, it gives an error like this :

Couldn't start project on Android: 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 just want to see the emulator in my pc without usb. I have an iPhone but it just shows up in my phone not in my pc using expo scan barcode. I don't want to do that because in my opinion it's not comfortable for debugging etc. I am using windows in my pc so I can't use iOS for emulator.

how to run expo android emulator on windows?

Faris Dewantoro
  • 1,597
  • 4
  • 17
  • 31
  • emulator normal start type in path folder :`C:\Users\[YourUserName]\AppData\Local\Android\SDK/emulator/emulator` – Omar bakhsh Jan 26 '21 at 02:20

4 Answers4

76

Yes you can:-(With zero android studio config)

  1. Install expo-cli globally.
  2. Install android Studio.
  3. Create a project by running expo-cli init
  4. No need of any configuration on android Studio.
  5. Open existing Project from android studio

Open the expo project

  1. then Open the created expo Project it will be available as an android project with a android logo on it
  2. then open the AVD Manager run avd manager

  3. Download and install whichever device you want but see to that its above android N and do it for x86

  4. after Installing the desired emulator

enter image description here

  1. run the emulator before running the project
  2. then run expo start to start the Project
  3. Go to the metro builder and say run android enter image description here

  4. if it doesn't run on the first go or if you get error close the project from emulator from recents and do a run on android again from metro builder don't close project just the running project from recent on emulator

from here

  1. then it should work
Snivio
  • 1,741
  • 1
  • 17
  • 25
  • How can this be approved pixel 2 with android pie 9.0 has no reaction with this. – juslintek Jun 05 '19 at 20:41
  • Thanks, it worked for me, just take time to start the android emulator, so just wait. – iamkdblue Apr 15 '20 at 13:57
  • This works ! could u also explain how to build an apk locally using expo – amar9312 Apr 17 '20 at 16:42
  • 1
    For neophytes like me who are confused about step 12: Metro Bundler (not "metro builder") is called "Expo DevTools" in the console output when you run your Expo app. By default, it is accessible at http://localhost:19002 – TanguyP Feb 13 '21 at 17:37
11

Maybe too late, but I found out that is simplier that what you think.

  1. Install your Android SDK (studio)
  2. Create new emulator: Go to Tools > AVD Manager > Create new virtual device (I chosen Nexus, Android 7)
  3. When you get new emulator installed try to find out list of it ( command: emulator -list-avds )
  4. !! If you do not have emulator in the path follow this commands in PowerShell:
    PATH = %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\platform-tools
    PATH= %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\emulator
    PATH= %PATH%;C:\Users\[YOURUSERPCNAME]\AppData\Local\Android\Sdk\tools\bin
  1. Run your emulator: emulator -avd [NAMEOFYOUREMULATOR] from the command emulator -list-avds
  2. When emulator runing go to your Expo root folder (wher package.json is) and run npm start
  3. Click on run in Run on Android device/emulator

Enjoy coding

Edit for Linux users

my linux usecase is as follow:

  1. Install Android studio and open it
  2. Install any emulator using AVD manager and try it's working
  3. Close studio and go to your android folder ~/Android/Sdk/(two options 'emulator/' or 'tools/'), basically you need to find emulator
  4. list item ./emulator -list-avds
  5. choose your emulator and run it ./emulator -avd <any emulator> if emulator not work use sudo if you do not get any options in Sdk folder but you installed emualtor than you did it propably as a superuser - then the easiest is to completely remove all android studio and install it again
x-magix
  • 2,623
  • 15
  • 19
3

Delete the directory C:\Users\Rizwan.expo\android-apk-cache and opening the project on android again It will run

2

There is another way to solve this problem. Follow the steps below in the same order:

  1. run expo start to start the Project

  2. Wait for the metro builder to be displayed in the browser.

  3. On the terminal, wait for all options to be displayed, like so: To run the app with live reloading, choose one of:

  4. Now load a device from Android Virtual Device in Android Studio (which already has the folder containing expo project open). On the terminal, press the key a.

Then the app should now open on the device being emulated.

Harish
  • 490
  • 2
  • 11
  • 19