Many Windows based Android developers are facing difficulties in running Android Studio on Windows machines due to lack of performance issues. But if you are developing mobile application using language like React Native you don’t actually need to work on Android Studio. But most of the time you have to use Android Emulators to test your application. If your windows machine does not have at least 16 GB of RAM you always face severe performance issue while running Android Emulators.
One solution to this issue is you can use your mobile phone
to test react native application without running on Android Emulators. For that
you only need to run Metro server on your PC and test application run on your
mobile phone. But this method has drawbacks you have only one platform to test
your application. If you want to test your application on multiple platforms
you have to use several Emulators with different Android versions and architectures.
Another solution is without load your Android Studio if you can use Android Emulators alone that will give better performance. For that you can use command line to load Android Emulators.
Open command prompt anywhere and use the following command
To get the list of available emulators
emulator -list-avds
To open a emulator
emulator -avd Nexus_5X_API_23
If you have multiple emulators this method is also cumbersome
process to type different command and load emulators. For that I wrote simple batch
script for each emulator needs to run and simply double click on the batch
script to run emulator as standalone application.
Here is the batch script file code:
C:/
cd C:\Users\<Your User>\AppData\Local\Android\Sdk\emulator
emulator -avd <Your Emulator Name>
Save this code with file name <Your File Name>.bat.
Then double click on the file to run the emulator.
Example:
C:/
cd C:\Users\User\AppData\Local\Android\Sdk\emulator
emulator -avd Pixel_2_API_30
Above script run Pixel_2_API_30 emulator in “C:\Users\User\AppData\Local\Android\Sdk\emulator”
path.
Happy coding….😀
Comments
Post a Comment