Skip to content

[Reproduce tool] Add Android emulator support.#1164

Merged
mbarbella-chromium merged 4 commits intomasterfrom
android-emulator
Nov 4, 2019
Merged

[Reproduce tool] Add Android emulator support.#1164
mbarbella-chromium merged 4 commits intomasterfrom
android-emulator

Conversation

@mbarbella-chromium
Copy link
Copy Markdown
Contributor

PTAL.

At this point, running the emulator works fine as does installing a test app and the rest of our workflow. For ASanified chrome in particular, I'm seeing a consistent crash in libGLESv2_enc.so that looks emulator-specific. This is good in that it shows we're able to run and detect crashes, but bad in that we won't be able to detect the right ones yet. That issue should be unrelated to this change though, so we can land this then resolve it after the fact.

@mbarbella-chromium
Copy link
Copy Markdown
Contributor Author

/gcbrun

# TODO(mbarbella): This is slow and flaky, but wait-for-device isn't usable if
# another device is connected (as we don't know the serial yet). Find a better
# solution.
time.sleep(30)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we start the emulator with a predictable serial?

https://developer.android.com/studio/run/emulator-commandline says there's

 -prop ro.serialno=123456

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++++1, predictable serial will be nice, user will be unhappy with 30 sec wait, too long.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great suggestion. Thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this doesn't seem to change how ADB recognizes the device. After setting that it still only recognized it as "emulator-5554", and running commands with -s 123456 failed.

# TODO(mbarbella): This is slow and flaky, but wait-for-device isn't usable if
# another device is connected (as we don't know the serial yet). Find a better
# solution.
time.sleep(30)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

++++1, predictable serial will be nice, user will be unhappy with 30 sec wait, too long.

@mbarbella-chromium
Copy link
Copy Markdown
Contributor Author

/gcbrun

@@ -29,8 +29,8 @@

CONFIG_DIRECTORY = os.path.join(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be used from constants.py

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed constants.py from this change (see the resolved comment thread). I originally intended to use CONFIG_DIRECTORY and some other variables from android.py as well, but realized it was unnecessary.

reproduce.sh Outdated
CLUSTERFUZZ_CONFIG_DIR=~/.config/clusterfuzz
ROOT_DIRECTORY=$(dirname $(readlink -f "$0"))

# Process command line arguments.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't --emulator be used here instead of --install-android-emulator, otherwise it means we provide both arguments when running reproduce.sh. --emulator could mean that we send --install-android-emulator

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

emulator-install-flag might be a confusing name. I'll change it to something like "additional_deps_args". I believe the logic here is what we want, so I'm not sure I understand the concern completely.

@mbarbella-chromium
Copy link
Copy Markdown
Contributor Author

/gcbrun

@mbarbella-chromium mbarbella-chromium merged commit fed349e into master Nov 4, 2019
@oliverchang oliverchang deleted the android-emulator branch November 15, 2019 02:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes CLA signed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants