Closed Bug 1218003 Opened 9 years ago Closed 8 years ago

|mach android-emulator --version x86| yields an unusable emulator on Mac OS X

Categories

(Testing :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: nalexander, Assigned: gbrown)

References

Details

Attachments

(1 file)

I believe that the "-enable-kvm" flag at https://dxr.mozilla.org/mozilla-central/source/testing/mozbase/mozrunner/mozrunner/devices/android_device.py#76 is not appropriate on Mac OS X.  After removing that, the emulator runs, but I can't |adb install| any packages to it -- everything just sits forever.
I dug into this quite a bit.  We see the symptoms of http://stackoverflow.com/a/10083307, but I did some testing and I don't think this is about the signing algorithm.  In the logcat, we also see simple certificate failures, with stacks like http://stackoverflow.com/q/8036422.  I've used jarsigner to verify the signatures, and they're fine.

I can install packages onto a fresh stock Android 23 x86 + GPS emulator and run them without difficulty.  I see nothing in Bug 894507 about signing keys or certificate chains, but I wonder if the repackaged AVD has a corrupt keychain?  gbrown, did you need to do anything here?  Is the modified su likely to have impact here?

I would like to get a functional x86 emulator available via |mach android-emulator| because I'm told it's important for contributors with slower hardware.  Any suggestions welcome.
Flags: needinfo?(gbrown)
I am pretty sure there's nothing special in the AVD regarding keys or certificates. I wouldn't expect su to have any impact on package installation.

Would you attach the logcat failure? Maybe ~/.mozbuild/android-device/emulator.log also?

I share your concern but it's hard for me to dig into this without a Mac. On Ubuntu, all's well: I just installed http://archive.mozilla.org/pub/mobile/tinderbox-builds/mozilla-central-android-x86/1449925892/fennec-45.0a1.en-US.android-i386.apk without incident. Could you try to install that apk, just in case there's some issue with your apk(s)?
Flags: needinfo?(gbrown)
I'll need to leave this bug open for the installation issue, but let's at least remove the -kvm-enable flag on osx for now.
Assignee: nobody → gbrown
Attachment #8698121 - Flags: review?(nalexander)
Comment on attachment 8698121 [details] [diff] [review]
remove -kvm-enable flag from osx command line

Review of attachment 8698121 [details] [diff] [review]:
-----------------------------------------------------------------

wfm.
Attachment #8698121 - Flags: review?(nalexander) → review+
(In reply to Geoff Brown [:gbrown] from comment #2)
> I am pretty sure there's nothing special in the AVD regarding keys or
> certificates. I wouldn't expect su to have any impact on package
> installation.
> 
> Would you attach the logcat failure? Maybe
> ~/.mozbuild/android-device/emulator.log also?
> 
> I share your concern but it's hard for me to dig into this without a Mac. On
> Ubuntu, all's well: I just installed
> http://archive.mozilla.org/pub/mobile/tinderbox-builds/mozilla-central-
> android-x86/1449925892/fennec-45.0a1.en-US.android-i386.apk without
> incident. Could you try to install that apk, just in case there's some issue
> with your apk(s)?

I did a little more testing.  It appears to not be the APK at all -- now I'm back to the "hanging during install".  (I can't explain the signing and certificate errors I was seeing).

I tried just "adb push"-ing a variety of files to the emulator, and I see... 130kb/s.  The APK is 45MB, so I might just not have waited the requisite 6 minutes!  Crazy!

I've tried with a fresh Android-x86 API 23 image, rumoured to have better performance, and I get 1600kb/s.  I think we might need to provide a newer image to get reasonable performance on Mac OS X.

gbrown, what do you think?
Keywords: leave-open
Interesting. I see slow installation on my Linux laptop also, against the x86 emulator.

gbrown@mozpad:~/src$ ./mach android-emulator --version x86 --force-update
 0:00.33 Fetching and installing AVD. This may take a few minutes...
 0:27.64 Starting Android emulator running Android 4.2 x86...
 1:47.82 Android emulator is running.
gbrown@mozpad:~/Downloads$ adb install fennec-45.0a1.en-US.android-i386.apk
719 KB/s (47491122 bytes in 64.421s)
	pkg: /data/local/tmp/fennec-45.0a1.en-US.android-i386.apk
Success


I get much better performance with the arm emulator, even 2.3:

gbrown@mozpad:~/src$ ./mach android-emulator --version 2.3 --force-update
 0:00.22 Fetching and installing AVD. This may take a few minutes...
 0:10.70 Starting Android emulator running Android 2.3...
 1:31.00 Android emulator is running.
gbrown@mozpad:~/Downloads$ adb install fennec-45.0a1.en-US.android-arm.apk
5065 KB/s (41964571 bytes in 8.090s)
	pkg: /data/local/tmp/fennec-45.0a1.en-US.android-arm.apk
Success

I had never noticed that before.
With a fresh Android-x86 API 23 image on Linux:

gbrown@mozpad:~/Downloads$ adb install fennec-45.0a1.en-US.android-i386.apk
7855 KB/s (47491122 bytes in 5.904s)
	pkg: /data/local/tmp/fennec-45.0a1.en-US.android-i386.apk
Success

Very nice.
See Also: → 1234281
:mattw was recently having trouble with the x86 emulator on osx. He was seeing INSTALL_PARSE_FAILED_NO_CERTIFICATES install failures until he installed HAXM.
I've talked to a couple of people recently using the x86 emulator on OS X and they have not reported any issues.

With the sdk 24 adb, on Linux, I find the current installation experience okay. We might get better installation performance with a 23+ image, but I'm reluctant to roll out support for another image just to improve install performance (it may happen more generically, if x86 becomes more important, prompting an update to our production test environment).
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WORKSFORME
Removing leave-open keyword from resolved bugs, per :sylvestre.
Keywords: leave-open
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: