Documentation
¶
Overview ¶
Package emulator provides common functionality to manage Android emulators.
Index ¶
- Variables
- func CreateAVD(osimage SystemImage, skin string, sdcardMB int) (string, string, error)
- func DeleteAVD(avdName string) error
- func DisableAnimations() error
- func DisableDarkTheme() error
- func EnableAnimations() error
- func EnableDarkTheme() error
- func SetDisplaySize(value float32) error
- func SetFontSize(value string) error
- func Skins() ([]string, error)
- func Start(name string) error
- func ToggleAnimations() error
- func ToggleDarkTheme() error
- type AVD
- type SystemImage
Constants ¶
This section is empty.
Variables ¶
var PrintInvocations bool
PrintInvocations controls whether to print invocations of subprocesses.
var Serial string
Serial is the serial port of the running AVD, for example "emulator-5554".
Functions ¶
func CreateAVD ¶ added in v0.3.0
CreateAVD creates a new Android Virtual Device and returns its name and path.
It wraps the avdmanager tool from Android SDK.Example AVD manager invocation:
avdmanager create avd \ --sdcard '8192M' \ --package "system-images;android-34;google_apis_playstore;arm64-v8a" \ --name "Pixel_7_API_34" \ --device "pixel_7"
In addition, it also automatically enables keyboard input.
func DisableAnimations ¶ added in v0.2.12
func DisableAnimations() error
func DisableDarkTheme ¶ added in v0.2.1
func DisableDarkTheme() error
func EnableAnimations ¶ added in v0.2.12
func EnableAnimations() error
func EnableDarkTheme ¶ added in v0.2.1
func EnableDarkTheme() error
func SetDisplaySize ¶ added in v0.2.1
func SetFontSize ¶ added in v0.2.1
func ToggleAnimations ¶ added in v0.2.12
func ToggleAnimations() error
func ToggleDarkTheme ¶ added in v0.2.1
func ToggleDarkTheme() error
Types ¶
type AVD ¶
type AVD struct { Name string Running bool // PID of the emulator process. Equals 0 if Running is false. Pid int }
AVD represents an Android Virtual Device.
It assumes that no 2 instances of the same AVD run at the same time.
type SystemImage ¶ added in v0.3.0
type SystemImage string
SystemImage is a unique identifier of an Android OS image .Examples:
- system-images;android-34;google_apis_playstore;arm64-v8a
- system-images;android-35;google_apis;x86_64
func SystemImages ¶ added in v0.3.0
func SystemImages() ([]SystemImage, error)
SystemImages returns installed Android system images.
func (SystemImage) ApiLevel ¶ added in v0.3.0
func (s SystemImage) ApiLevel() string
ApiLevel returns the API level of this system image. Error can be returned when e.g. the new Android version still has only a codename, not a number.