AndroidViewClient - How to get notified when the Android Virtual Device start process is completed?

66 Views Asked by At

I use AndroidViewClient in order to use MonkeyRunner through Python. I need to start the AVD programmatically and get notified when the AVD start process is completed. How can I catch that event? The execution just does not reach the line after the subprocess.run() function.

Here is how I start my AVD:

subprocess.run('emulator -avd Nexus_5_API_26 -wipe-data', shell=True)
// the execution just does not reach this line
1

There are 1 best solutions below

0
On BEST ANSWER

You can detect that the AVD is ready using

adb wait-for-device

also, to start the emulator in the background you need Popen.