Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 413
Danial Jalalnouri Avatar asked Sep 12 '18 08:09

Danial Jalalnouri


People also ask

Is it possible to run Android apps in WebStorm?

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.

How do I run an emulator from WebStorm?

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.

How to deploy an Android app to a virtual device?

Select Run menu and then select “ Run ‘app’ ” menu item. Android Studio will start Run the Project. Step 3. Android Studio will open “ Select Deployment Target ” dialog, and lists list of Available Virtual Devices to allow us to select the deployment Target for our Project.

Can I use WebStorm for React Native programming?

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.


2 Answers

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

IDE screenshot

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.

like image 24
Martin Zeitler Avatar answered Oct 02 '22 09:10

Martin Zeitler


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.

like image 171
Danial Jalalnouri Avatar answered Oct 02 '22 09:10

Danial Jalalnouri