Skip to content
forked from Flojomojo/pyavd

A python wrapper for the avdmanager command line tool

License

Notifications You must be signed in to change notification settings

MelodyEars/pyavd

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pyavd

A python wrapper for the avdmanager and emulator command line tool

Pyavd is a wrapper for the avdmanager from google and the commonly used emulator from google. You can create, manage and start Android Virtual Devices (AVDs) using python.

Requirements

  • currently only linux is officially supported, but windows/macos might work as well
  • installed android-sdk

Example

from time import sleep
import pyavd

# If the emulator/avdmanager executables are not in the path, include the following
#pyavd.pyavd.avd_cmd = "/path/to/avdmanager"
#pyavd.pyavd.emulator_cmd = "/path/to/emulator"

# Get all the avaliable devices
devices = pyavd.get_devices()
    
# Declare a package and name
package = "system-images;android-32;google_apis;x86_64"

name = "Hello from pyavd"

# Create a avd with the declared variables and a chosen device
avd = pyavd.create_avd("code", package, devices[22])

# Use a custom config
custom_config = "-no-snapshot"

# Start it in detached mode
p = avd.start(detach=True, config=custom_config)

sleep(10)

# After 10 seconds stop it again and delete it
avd.stop()

avd.delete()

About

A python wrapper for the avdmanager command line tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%