How to run Android Virtual Device in WebStorm - android

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

Related

Expo run on android emulator using windows 10

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.

How to use Youwave in place of Android Emulator

I've tried for days and failed to run AVD on my PC. So I decided to look for an alternative and found out that Youwave can be used as an emulator. Here is my question: How can I run Android source (apps not finished so they are not .apk) on Youwave?
You can't run Android Source which is not finished to become .apk.
The best alternative of emulator is Genymotion.
hopefully it would be useful for others that reach this page through googling,
run command prompt in windows by typing "cmd" in the search field of the start menu
change the directory to "platform-tools" in your sdk folder. For example, suppose that your sdk is located in "c:\android\source\sdk\" use the command "cd\android\source\sdk\platform-tools" for changing the current directory.
Run the following command for connecting YouWave to AndroidStudio:
"adb connect 127.0.0.1:5558"
Enjoy it!

Launching Android Open Source SDK from Eclipse in Linux

I have downloaded Android Open Source Project and build it in Linux from command line. All are fine. I can use the emulator.
I installed also Eclipse and AVD via eclipse. Now I want to use the open source emulator that I build from command line. How can I do that?
Mahbub
From the shell in which you build AOSP you can run emulator and it will start an emulator which it built as part of AOSP along with the system image created in your AOSP build. You can also use the SDK provided emulator by passing it command line arguments for the kernel, init RAM disk, system partition and data partition.

How to start Android AOSP emulator on MAC

I have downloaded and compiled Android source code per instructions on Android source website (http://source.android.com/source/building.html)
I chose
$ lunch full-eng
an emulator engineering build and everything has compiled just fine.
Then it says to launch the image inside an emulator just type:
The emulator is added to your path automatically by the build process. To run the emulator, type
$ emulator
Well, not sure it is added to the path. Typing emulator does not do anything.
However if I go to
out/host/darwin-x86/bin/emulator
emulator: ERROR: You did not specify a virtual device name, and the system
directory could not be found.
If you are an Android SDK user, please use '#<name>' or '-avd <name>'
to start a given virtual device (see -help-avd for details).
So I am confused ... at this point do I have to create an AVD ?
How do I create an AVD for this image exactly ?
Has anyone done this on MAC can they supply me with some instructions ?
Thanks
I'm not sure if there is any difference on osx, but it is a common error on Linux. After you build the whole AOSP, the building process will add the <AndroidBase>/out/host/<host-arch>/bin/emulator into the PATH, but after you restart your computer or open another session, emulator will no longer be in the path.
To fix the "You did not specify a virtual device name, and the system
directory could not be found" error, you can explicitly set ANDROID_PRODUCT_OUT to point to your disk image directory. In general, the disk image directory would be <AndroidBase>/out/target/product/generic. So
$export ANDROID_PRODUCT_OUT=<ANDROID BASEDIR>/out/target/product/generic/
would help.
Actually, you can run
. build/envsetup.sh
setpaths
It will do a similar work for you.
I build with aosp_x86_64-eng and have verified that the following will launch the emulator in a new terminal window:
cd /[your AOSP WORKING_DIRECTORY]
source build/envsetup.sh
lunch aosp_x86_64-eng
cd $ANDROID_PRODUCT_OUT
emulator

How to install an application on android emulator?

When i enter "adb install asdasd.apk" to cmd returns "error:device not found". How can I fix this?
Just copy that apk file into ( D:\android-sdk\platform-tools ) android sdk platform tools.
and then open the cmd prompt.
then, come into that platform tools path in cmd prompt.
then, give like this in cmd -- adb install (appName).apk
wait few minutes and get success respomse in cmd prompt..
First, familiarize yourself with a concept of AVD. That's basically an instance of the emulator - it has a bunch of settings, like the Android version to use and screen size and an SD card image.
You cannot install stuff "in the emulator" - you can only install stuff into a specific AVD. For that, you need to create and run an AVD first. For that, use "AVD Manager" from Eclipse or standalone.
Under the Android SDK folder in Explorer, run "AVD Manager". Choose an AVD (or create a new one if you don't have any). Select, click "Start".
Does the emulator show up when you run the following command?
adb devices
If not, you might have to boot up the AVD first, but if I remember correctly it should be starting it up by itself.
Have you created a new emulator for your project? And are you using Eclipse? Eclipse has an ADT plugin which is useful as it allows you to open the AVD manager through it. This plugin will give you this option in the Windows tool bar of Eclipse: Windows>AVD manager.
Create a new project based on the emulator and click the run button which will install your project onto the emulator. If you have an Android device I recommend turning USB development mode in your phones settings and running your project straight onto your device as it will be a lot faster. Hope this helps
this is what i did :
first run the "AVD Manager"-> choose an AVD -> click "Start"
immediately after
you click on "Start"
use command on cmd as,
adb install asdasd.apk
then in my case (Windows), asked to place .apk file in data/local/tmp/
what i did was copy and paste .apk file into data/local/tmp
and again use command
adb install asdasd.apk
then cmd prompted-> Success
You can also use command
adb devices
command for check whether emulator is in the list
Actually you may need to run AVD several times

Categories

Resources