xharness icon indicating copy to clipboard operation
xharness copied to clipboard

Can Xharness.CLI boot Android emulators?

Open EgorBo opened this issue 5 years ago • 5 comments

XHarness.CLI for iOS is able to boot iOS simulators without help, is it possible to do it for Android as well?

EgorBo avatar May 14 '20 22:05 EgorBo

Possibly (I'm fighting an issue with them being offline already), but what's the goal here? Currently for the emulator setup we have, they're booted as services by systemd.

The tricky part we'd have to solve for this is that the location of the executable would not be known so resolution of the path becomes a challenge.

MattGal avatar May 18 '20 15:05 MattGal

@MattGal

but what's the goal here?

To be consistent with iOS where Xharness does boot them

solve for this is that the location of the executable

what executable?

EgorBo avatar May 18 '20 15:05 EgorBo

what executable?

The emulator. On linux and on how we've set up our machines, it's $ANDROID_SDK_ROOT/emulator/emulator , but this could be anywhere.

MattGal avatar May 18 '20 15:05 MattGal

@EgorBo , after discussing with the other XHarness team members I think this is a non-starter for Android. When using iOS simulator, one always knows the OS (it's always MacOS) and the simulator is always in a static location relative to XCode. On Android, we support running from Windows, Linux, and MacOS, there can be any number of emulators and devices attached to the machine, and the location of these emulators can be anywhere.

XHarness will always print error messages ( I can try to make them extra-explicit) when no usable devices are found, but as I can conceive of no reliable way to find the emulators and start them (and since finding and starting random processes on the user's machine might be unwanted ) I am closing this.

If you have a reliable strategy for finding and starting emulators that works on all three OSes we can certainly discuss it at a later juncture.

MattGal avatar May 18 '20 15:05 MattGal

We could use adb shell getprop sys.boot_completed (or dev.bootcomplete) and see if it is done.

https://github.com/cake-contrib/Cake.Android.Adb/blob/85c37d0026ec9e924ccd5950827cfaf07fe9d7d8/src/Cake.Android.Adb/Aliases/AdbAliases.cs#L337

mattleibow avatar Oct 16 '23 15:10 mattleibow