Ubuntu emulator is very useful in the development process, especially when there is no Ubuntu device. After attaching the emulator to the SDK, you can run the program on it, install the click Packets, and so on, similar to the operations on the physical device.
Here you can learn how to use the Ubuntu emulator from the Ubuntu SDK, including:
- Creating an Emulator
- Start the emulator
- Attaching the emulator to the SDK
- Open the root shell connected to the emulator
Note : The Ubuntu emulator is being developed quickly, including its support in the SDK. So stay agile, keep up to date with new information, and always be aware of the latest changes!
tip : For a first-class Ubuntu emulator and SDK experience, you can update your system from the SDK PPA by referencing the Install SDK Tutorial.
What is an Ubuntu emulator?
It is an emulator that can run on a computer desktop, rather than on a physical device, to simulate Ubuntu phones and tablets. It looks and works the same way as an Ubuntu phone or tablet, and can interact with the GUI with the mouse instead of physical touch and swipe gestures.
tip : The emulator is slower than the physical device, so be patient.
Creating an Emulator instance
- In the Ubuntu SDK, open the Devices tab. At the bottom, select the Emulators tab.
- Near the upper-left section, enter the name of the new emulator in the name field.
- Click the Create new Emulator button.
Note : It takes a little bit of time to create the emulator.
After success, the new emulator is listed on the right side of the Emulators tab and lists its name and other descriptive information, including "Version=number", which is the build number for Ubuntu phones and tablet images.
Starting the emulator instance
- In the Ubuntu SDK, open the Devices tab. At the bottom, select the Emulators tab.
- Select an emulator from the emulator listed on the right side of the screen.
- Click Start selected Emulator
tip : It takes some time for the emulator to start.
When the boot is complete, the emulator appears in a separate window. Interact with the GUI using the mouse and the onscreen keyboard that is displayed when needed.
Attaching the running emulator as a device to the SDK
Once the emulator instance is running, it can be attached as a device to the SDK. This allows you to use the SDK to run the application on that instance and to install the click Packet onto it.
tip : From the SDK point of view, actually the physical device and emulator device are the same.
- Verify that your emulator instance is running in the window of your desktop and that its GUI is responsive.
- In the Ubuntu SDK, open the Devices tab and its Device Actions Sub-tab (at the bottom).
- Click the redetect devices button.
Upon success, the SDK Devices tab displays a message that begins with "Your device have been enabled for developer use", and the top device Serial number field displays the serial number of the emulator instance:
Now that your emulator is attached, the SDK features you can use on your physical Ubuntu device can be used on that emulator. For example, you can run the application directly from the SDK on your device.
Accessing the shell of a running emulator
Now you can use the adb command to open the shell that is connected to the emulator, as follows:
- Use CTRL + ALT + T to open a terminal shell
- Ensure that the ADB can see the emulator in the following ways:
$ adb devices List of devices attached emulator-5514
"emulator-5514" is the serial number of the emulator explained above.
- Create a root shell in the following ways:
$ adb shell
Use CTRL + D to exit the shell.
More information
Next steps
Now that you have an emulator running as an add-on, you can view the tutorial running the application from the SDK.
Using the Ubuntu emulator in the SDK