'mach android-emulator' waits too long on startup - authentication in new emulator

RESOLVED FIXED in Firefox 50

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: gbrown, Assigned: gbrown)

Tracking

49 Branch
Firefox 50
Points:
---

Firefox Tracking Flags

(firefox50 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

3 years ago
After updating my android sdk, I noticed 'mach android-emulator' waited for an extra minute or so after the emulator had started before completing its wait-for-startup sequence.

Running with --verbose provides more info:

gbrown@mozpad:~/src$ ./mach android-emulator --verbose
DEBUG: adb found at /home/gbrown/.mozbuild/android-sdk-linux/platform-tools/adb
DEBUG: Emulator created with type 4.3
DEBUG: emulator found at /home/gbrown/.mozbuild/android-sdk-linux/tools/emulator
DEBUG: AVD found at /home/gbrown/.mozbuild/android-device/avd/mozemulator-4.3.avd
 0:00.18 Starting Android emulator running Android 4.3...
DEBUG: Starting the emulator with this command: /home/gbrown/.mozbuild/android-sdk-linux/tools/emulator -avd mozemulator-4.3 -port 5554 -show-kernel -debug init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket
DEBUG: Emulator output will be written to '/home/gbrown/.mozbuild/android-device/emulator.log'
DEBUG: Emulator started with pid 31342
DEBUG: Waiting for device status...
DEBUG: Device status verified.
DEBUG: Checking that Android has booted...
DEBUG: Android boot status verified.
DEBUG: >>> avd status
DEBUG: <<< 
allows you to control (e.g. start/stop) the execution of the virtual device

available sub-commands:
    name             query virtual device name

KO:  bad sub-command

DEBUG: >>> redir list
DEBUG: <<< KO: unknown command, try 'help'

DEBUG: >>> network status
DEBUG: <<< KO: unknown command, try 'help'

 1:00.42 Android emulator is running.
 1:00.42 Use 'mach install' to install or update Firefox on your emulator.


At issue is that the new emulator requires authentication:

gbrown@mozpad:~/src/testing$ telnet 127.0.0.1 5554
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Android Console: Authentication required
Android Console: type 'auth <auth_token>' to authenticate
Android Console: you can find your <auth_token> in 
'/home/gbrown/.emulator_console_auth_token'
OK
avd status
allows you to control (e.g. start/stop) the execution of the virtual device

available sub-commands:
    name             query virtual device name

KO:  bad sub-command


There's some useful info at https://developer.android.com/studio/run/emulator-commandline.html.
Assignee

Comment 1

3 years ago
As documented at https://developer.android.com/studio/run/emulator-commandline.html, writing an empty auth file disables emulator authentication, and then the emulator works just like earlier versions.

Works great for me:

gbrown@mozpad:~/src$ ./mach android-emulator --verbose
DEBUG: adb found at /home/gbrown/.mozbuild/android-sdk-linux/platform-tools/adb
DEBUG: Emulator created with type 4.3
DEBUG: emulator found at /home/gbrown/.mozbuild/android-sdk-linux/tools/emulator
DEBUG: AVD found at /home/gbrown/.mozbuild/android-device/avd/mozemulator-4.3.avd
 0:00.18 Starting Android emulator running Android 4.3...
DEBUG: deleted /home/gbrown/.emulator_console_auth_token
DEBUG: Starting the emulator with this command: /home/gbrown/.mozbuild/android-sdk-linux/tools/emulator -avd mozemulator-4.3 -port 5554 -show-kernel -debug init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket
DEBUG: Emulator output will be written to '/home/gbrown/.mozbuild/android-device/emulator.log'
DEBUG: Emulator started with pid 450
DEBUG: Waiting for device status...
DEBUG: Device status verified.
DEBUG: Checking that Android has booted...
DEBUG: Android boot status verified.
DEBUG: >>> avd status
DEBUG: <<< 
virtual device is running
OK
DEBUG: >>> redir list
DEBUG: <<< 
no active redirections
OK
DEBUG: >>> network status
DEBUG: <<< 
Current network status:
  download speed:          0 bits/s (0.0 KB/s)
  upload speed:            0 bits/s (0.0 KB/s)
  minimum latency:  0 ms
  maximum latency:  0 ms
OK
 0:40.37 Android emulator is running.
 0:40.37 Use 'mach install' to install or update Firefox on your emulator.
Attachment #8766952 - Flags: review?(jmaher)
Attachment #8766952 - Flags: review?(jmaher) → review+

Comment 2

3 years ago
Pushed by gbrown@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/98317a8a0ba4
Disable android emulator authentication; r=jmaher

Comment 3

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/98317a8a0ba4
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 50
You need to log in before you can comment on or make changes to this bug.