Android simulators

Android simulators are launched in the same way as the iOS simulators. In the terminal where the React Native packager is running, press "A". However, there's a caveat - you have to start the Android device emulator before starting the app within the React Native package. If you don't, you'll see a message that looks like this when you press "A":

2:37:02 p.m.: Starting Android...
Error running adb: No Android device found.

This has been historically difficult to do with Android. Getting Android device emulators up and running is much simpler now, with the help of Android Studio. Once you have Android Studio installed, you can open the Android Virtual Device manager and add any device you like:

You can click on the Create Virtual Device button to create a new device:

Once you've created the device that you want to test your React Native app on, you can click the green play button. This will start the emulator:

If you go back to the terminal where the React Native packager is running and press "a", you should see the following output:

2:49:07 p.m.: Starting Android...
2:49:08 p.m.: Finished building JavaScript bundle in 17ms
2:49:10 p.m.: Running app on Android SDK built for x86 in development mode

And if you go back to your Android emulator, your React Native app should be up and running:

Like the Expo app and the iOS simulators, this simulator will live reload as the source of your application changes, thanks to the React Native packager.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.127.232