Expo run on android emulator using windows 10 - android

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?

Yes you can:-(With zero android studio config)
Install expo-cli globally.
Install android Studio.
Create a project by running expo-cli init
No need of any configuration on android Studio.
Open existing Project from android studio
then Open the created expo Project it will be available as an android project with a
android logo on it
then open the AVD Manager
Download and install whichever device you want but see to that its above android N
and do it for x86
after Installing the desired emulator
run the emulator before running the project
then run expo start to start the Project
Go to the metro builder and say run android
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
then it should work

Maybe too late, but I found out that is simplier that what you think.
Install your Android SDK (studio)
Create new emulator: Go to Tools > AVD Manager > Create new virtual device
(I chosen Nexus, Android 7)
When you get new emulator installed try to find out list of it ( command: emulator -list-avds )
!! 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
Run your emulator: emulator -avd [NAMEOFYOUREMULATOR] from the command emulator -list-avds
When emulator runing go to your Expo root folder (wher package.json is) and run npm start
Click on run in Run on Android device/emulator
Enjoy coding
Edit for Linux users
my linux usecase is as follow:
Install Android studio and open it
Install any emulator using AVD manager and try it's working
Close studio and go to your android folder ~/Android/Sdk/(two options 'emulator/' or 'tools/'), basically you need to find emulator
list item ./emulator -list-avds
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

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

There is another way to solve this problem. Follow the steps below in the same order:
run expo start to start the Project
Wait for the metro builder to be displayed in the browser.
On the terminal, wait for all options to be displayed, like so: To run the app with live reloading, choose one of:
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.

Related

No emulator images (avds) found. while running cordova applicaction

While running my cordova application through command promt I'm getting the following error:
No emulator images (avds) found.
1. Download desired System Image by running: "D:\Software\sdk\tools\android.bat"sdk
2. Create an AVD by running: "D:\Software\sdk\tools\android.bat" avd HINT: For a faster emulator, use an Intel System Image and install the
HAXM device driver
How can I fix this issue?
I'm new to this hybrid application development ,please help me out this issues.
Try below from your command line:
# create avd
android avd
# run emulator
ionic emulate android
I haven't work with cordova applications before, but I think the answer is clear, it's asking you to make an emulator so that your application can run on.
first, you need to run the .bat file specified on your local machine
D:\Software\sdk\tools\android.bat
choose the sdk. And then re-run the .bat file choosing avd.
and by doing so an emulator should be installed on your machine for the cordova application to run on.

Android studio AVD doesn't show up in terminal when running ionic cordova emulate android

I have an AVD that I created in Android Studio, here are the details of it:
When I run ionic cordova emulate android in my ionic project, I get this error:
ANDROID_HOME=/Users/joshterrill/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_192.jdk/Contents/Home
Error: No emulator images (avds) found.
1. Download desired System Image by running: /Users/joshterrill/Library/Android/sdk/tools/android sdk
2. Create an AVD by running: /Users/joshterrill/Library/Android/sdk/tools/android avd
HINT: For a faster emulator, use an Intel System Image and install the HAXM device driver
[ERROR] An error occurred while running cordova emulate android (exit code 1).
When I run this command: ~/Library/Android/sdk/tools/android list avd I get this:
Joshs-MacBook-Pro:~ joshterrill$ ~/Library/Android/sdk/tools/android list avd
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running /Users/joshterrill/Library/Android/sdk/tools/bin/avdmanager list avd
Available Android Virtual Devices:
Joshs-MacBook-Pro:~ joshterrill$
So it doesn't show that I have any there.
Also, here's a screenshot of Android Studio which shows that my SDK is currently installed in the same place that I'm looking for the AVD:
Any ideas on why the AVD isn't showing up? I understand that the first error shown from the emulate command gives me the ability to create an AVD from the command line, but I'm going to need to create various AVD's from Android Studio and need to figure out why the terminal doesn't see them.
The answer to this problem was having the correct information in my $PATH. Here's what ended up working for me:
export ANDROID_HOME=~/Library/Android/sdk
export PATH=${PATH}:/Users/mylaptop/Library/Android/sdk/platform-tools/adb:/Users/mylaptop/Library/Android/sdk/platform-tools:/Users/mylaptop/Library/Android/sdk/tools

How to run Android Virtual Device in WebStorm

I've started react native programming recently, I use WebStorm for coding, I always have to run Android Studio and start my Android Virtual Device and then Close Android Studio and work with WebStorm and run and test my react native app.
how can I run my Android Virtual Device from webstorm without the need to open Android Studio?
solution
Finally, with the help of "Martin Zeitler", I succeeded in doing this in the following way:
In webstorm select File>settings, in search bar type "External Tools" select "External Tools", in "tools" section click on plus icon (add) fill this window like my parameter:
Name: android avd
*as you like
Program: C:\Users(your user name)\AppData\Local\Android\Sdk\emulator\emulator.exe
*this is your emulator.exe address and this is the default address, you have to replace (your user name) with your system user name or change the address for locating to your emulator.exe address
Arguments: -avd Nexus_5X_API_23
*Nexus_5X_API_23 is a sample you have to type your emulator name that you create it before in android studio
Working directory: C:\Users(your user name)\AppData\Local\Android\Sdk\emulator
*like Program address but without emulator.exe
click ok
now in webstorm in tools menu in External Tools section you can find android avd or your custom name. by click on it you can run your emulator from webstorm.
finally you don't need android studio at all , you can run it from webstorm.
it might be easier to explain with a screenshot ...
except that for Windows™ you'd have to use a .bat batch script, instead of .sh shell script
the shell script, which is being used in the example, can be found here.
it does a little more than just start the emulator and is for Linux only.
(just to provide an idea, what can be done in the given situation).
here it is explained:
Start the emulator from the command line.
No, WebStorm provides no Android support and there are no plugins you can use to run android virtual devices within Webstorm.
Although you can run android emulator from terminal without using Android studio.
For example on Windows, you can use the following from the command prompt:
start "" C:\Users\qasim\AppData\Local\Android\Sdk\emulator\emulator.exe #Pixel_XL_API_28

How to set the default Android Emulator

I am building an app with NativeScript, where I run:
$ tns run android --emulator
to build the app and launch it in an emulator. When I do this, the default android emulator boots on my machine, which is unusably slow...
In all the demos, they are using the Genymotion Emulator. I have installed this, but the NativeScript command still launches the default emulator. How do I get this to launch on the genymotion emulator?
NB: I am using Windows 10
Update:
Even if I run the command with the Genymotion emulator running (and nothing else), I get the following log output and a new terminal window is opened running android-sdk/tools/emulator-arm.exe
BUILD SUCCESSFUL
Total time: 11.959 secs
Project successfully built.
Using C:\Users\George\Source\Repos\NativeScript-App\Bluetooth\platforms\android\build\outputs\apk\bluetoothdemo-debug.apk
Starting Android emulator with image Xamarin_Android_API_23
That looks as though it is referencing the emulator I had been using when I was developing with Xamarin. Any ideas where I can change that, or why that is being called?
start Genymotion, then start one of the devices that you have setup in Genymotion
then check that the device is seen:
$ tns device
then run nativescript like so
$tns run android --geny 192.111.222.33:555
(or whatever is the name that you get from the tns device command)
To my experience --emulator always tries to start the stock emulators. Try to start genymotion and then just tns run android (w/o the --emulator option).
I think it does that when there is no emulator running.
Try starting Genymotion first, launch the image you want, then run the "tns run adroid" command.
I had a similar issue.
To use GenyMotion by default, first delete all the Android emulators using
android avd
I then followed the solution on this thread:
React-Native, Android, Genymotion: ADB server didn't ACK
Edit the settings in GenyMotion to use the android SDK you downloaded. (path for Windows is Users/YOUR-SYSTEM/AppData/Local/Android/android-sdk)
You still have to run the device on GenyMotion before running the emulator
tns run android

How to use Genymotion to launch an android app on PC?

I created an android project with the eclipse ADT from the android-bundle, and generated the apk. I downloaded and installed Genymotion with the integrated Oracle Virtualbox on my computer running Windows XP. How to run my application with Genymotion ?
If you have a genymotion emulator running ADB will detect it and give you the option to install it directly on it from eclipse. Another option is to install it through terminal by doing:
adb install myapk.apk
Before using adb from terminal remember to set up ANDROID_HOME, and add ANDROID_HOME/platform-tools to the path. Hope this helps
if you have APK than just Drag and Drop to Genymotion emulator by default it store in
/sdcard/download(its toast location where store file) go to there and manually install your APK
you can also put any file not only APK :)
This is online plugin for eclipse http://plugins.genymotion.com/eclipse
after install it you can use as native emulator.You can find icon in eclipse menu start emulator from it and run project
To deploy an application to a virtual device, use either of the following methods:
Drag and drop the application APK file into the virtual device window.
Run the following command: adb install .apk.
Download and install the application directly from the virtual device
using a web link.

Categories

Resources