4.9 AVD Command-line Creation
As previously discussed, in addition to the graphical user interface it is also possible to create a new AVD directly from the command-line. This is achieved using the avdmanager tool in conjunction with some command-line options. Once initiated, the tool will prompt for additional information before creating the new AVD.
The avdmanager tool requires access to the Java Runtime Environment (JRE) in order to run. If, when attempting to run avdmanager, an error message appears indicating that the ‘java’ command cannot be found, the command prompt or terminal window within which you are running the command can be configured to use the OpenJDK environment bundled with Android Studio. Begin by identifying the location of the OpenJDK JRE as follows:
1. Launch Android Studio and open the AndroidSample project created earlier in the book.
2. Select the File -> Settings... menu option (Android Studio -> Preferences... on macOS).
3...