New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing Android Emulator documentation #1677

Open
SinZ163 opened this Issue Sep 11, 2018 — with docs.microsoft.com · 4 comments

Comments

Projects
None yet
6 participants

SinZ163 commented Sep 11, 2018 — with docs.microsoft.com

There is a section on this article dedicated to testing on the Android Emulator, but the section just says it only works on a MacOS image, without giving any YAML on how to actually go about doing it


Document details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@DavidStaheli

This comment has been minimized.

Collaborator

DavidStaheli commented Sep 11, 2018

@PBoraMSFT, is this something your team wants to look at? We can chat about it too.

@john-mccartin-id

This comment has been minimized.

john-mccartin-id commented Sep 17, 2018

@DavidStaheli My organization needs help on this as well. Could you point us in the right direction on this?

@AndreyMitsyk

This comment has been minimized.

AndreyMitsyk commented Oct 29, 2018

The example script below installs required android system-image, creates and starts emulator in background, and waiting for full android loading on emulator.

VSTS bash step (inline):

#!/usr/bin/env bash

# Install system image
echo "y" | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-27;google_apis;x86'

# Start ADB
$ANDROID_HOME/platform-tools/adb devices

# Create emulator
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n test_android_emulator -k 'system-images;android-27;google_apis;x86' --force

# Start emulator in background
nohup $ANDROID_HOME/emulator/emulator -avd test_android_emulator -no-snapshot > /dev/null 2>&1 & $ANDROID_HOME/platform-tools/adb wait-for-device shell 'while [[ -z $(getprop sys.boot_completed | tr -d '\r') ]]; do sleep 1; done; input keyevent 82'

echo "Emulator started"
@janpio

This comment has been minimized.

Contributor

janpio commented Nov 15, 2018

This works for vmImage: 'macOS-10.13' @AndreyMitsyk 👍


Any way to get Android Emulator working on ubuntu-16.04 and vs2017-win2016?

Windows and Linux currently both fail at the "start emulator" step. For Windows I don't have the correct command to start the emulator and check if it started successfully at the same time, for Linux the command from Mac just seems to run indefinitely :/

(On Linux I had to make the Android tools executable with chmod to get this far, otherwise I got /usr/local/lib/android/sdk/../tools/bin/sdkmanager: Permission denied)


Update on Windows: Many hoops to jump through later I got this on Windows:

2018-11-15T17:23:22.2688974Z emulator: ERROR: x86 emulation currently requires hardware acceleration!
2018-11-15T17:23:22.2689801Z Please ensure Windows Hypervisor Platform (WHPX) is properly installed and usable.
2018-11-15T17:23:22.2689941Z CPU acceleration status: Android Emulator does not support nested virtualization.  Your VM host: 'Microsoft Hv' (Hyper-V)

Should have thought about that beforehand... Well. Lesson learned 🤷‍♂️


More Updates: End of the line for Linux as well it seems:

2018-11-15T20:51:41.1159301Z emulator: ERROR: x86 emulation currently requires hardware acceleration!
2018-11-15T20:51:41.1160136Z Please ensure KVM is properly installed and usable.
2018-11-15T20:51:41.1160573Z CPU acceleration status: KVM requires a CPU that supports vmx or svm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment