2017年3月8日 星期三

how to open android emulator manually

Android emulator is required when developing react-native. In this article, we will discuss how to open android emulator manually.

You can refer installation process described by react as following
https://facebook.github.io/react-native/docs/getting-started.html

It mentions that emulator manager can be invoked by

   android avb  

However, it is unavailable for newly version of Android Studio and it shows



What happen if we ignore the above and execute react-native run-android ?


No doubt, errors show to break my heart. React tells you that running android emulator is required for running react-native android app.

In order to solve the problem, you have to find android first. In mac, it would be
   ~/Library/Android/sdk/tools   

then run 
   emulator -list-avds   

If you have completed installation process of android studio and configured emulator properly, you will show available device name.

* If it does not display any device, you must config emulator device from android studio

next run
    emulator -avd <device name>    

Please replace <device name> as your available devices, for example
     emulator -avd Nexus_5_API_25    

then, emulator will be invoked


After booting, you can run react-native app by executing
    react-native run-andriod    

* about :app:installDebug FAILED, please check whether VM is running in your environment such as Docker. Before you start android emulator, please stop those VMs




沒有留言:

張貼留言