Closed
Bug 1290627
Opened 8 years ago
Closed 8 years ago
mach bootstrap + mach android-emulator does not create a working setup - emulator fails to start
Categories
(Firefox Build System :: Android Studio and Gradle Integration, defect)
Firefox Build System
Android Studio and Gradle Integration
x86_64
macOS
Tracking
(Not tracked)
RESOLVED
DUPLICATE
of bug 1289226
People
(Reporter: robwu, Assigned: gbrown)
References
Details
Attachments
(1 file)
690.26 KB,
image/png
|
Details |
I'm trying to run xpcshell tests for Fennec using an emulator, and expect that "mach bootstrap" and "mach android-emulator" should have setup everything that I need.
Unfortunately the emulator does not start at all. I have tried several things, listed below:
Setup is as follows, on OS X 10.11:
Environment:
- OS X 10.11
- adb was already installed via brew install android-platform-tools
- I have a ~/mozilla-central and ran "mach bootstrap" for the desktop build before.
Ran the following steps:
1. Install dependencies (Java, Android SDK, etc)
~> mach bootstrap # Choose Android (artifact) build (I tried both).
2. Created .mozconfig-android per instructions (http://searchfox.org/mozilla-central/rev/1112b7a5222b71a3b5b68bd531f50ded6bcbc770/python/mozboot/mozboot/android.py#81)
3. Just in case, run bootstrap again with the right mozconfig:
MOZCONFIG=$HOME/mozilla-central/.mozconfig-android mach bootstrap
4. Now try to start the emulator. I tried using --version=x86 (overriding the default 4.3) and --force to no avail:
~> MOZCONFIG=$HOME/mozilla-central/.mozconfig-android mach android-emulator
0:00.28 Starting Android emulator running Android 4.3...
WARNING: Emulator has already completed!
0:15.49 Unable to verify that emulator is running.
0:15.49 Use 'mach install' to install or update Firefox on your emulator.
5. Somehow the emulator terminated early, so I ran the command directly:
~> ANDROID_SDK_HOME=$HOME/.mozbuild/android-sdk-macosx/ ANDROID_AVD_HOME=$HOME/.mozbuild/android-device/avd $HOME/.mozbuild/android-sdk-macosx/tools/emulator -avd mozemulator-4.3 -port 5554 -show-kernel -debug init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket
Segmentation fault: 11
6. Segfault? Let's try a debugger (lldb):
ANDROID_SDK_HOME=$HOME/.mozbuild/android-sdk-macosx/ ANDROID_AVD_HOME=$HOME/.mozbuild/android-device/avd lldb -- $HOME/.mozbuild/android-sdk-macosx/tools/emulator -avd mozemulator-4.3 -port 5554 -show-kernel -debug init,console,gles,memcheck,adbserver,adbclient,adb,avd_config,socket
(lldb) r
Process 74890 launched: '~/.mozbuild/android-sdk-macosx/tools/emulator' (x86_64)
Process 74890 stopped
* thread #1: tid = 0x789d26, 0x00007fff91ba3132 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
frame #0: 0x00007fff91ba3132 libsystem_c.dylib`strlen + 18
libsystem_c.dylib`strlen:
-> 0x7fff91ba3132 <+18>: pcmpeqb (%rdi), %xmm0
0x7fff91ba3136 <+22>: pmovmskb %xmm0, %esi
0x7fff91ba313a <+26>: andq $0xf, %rcx
0x7fff91ba313e <+30>: orq $-0x1, %rax
(lldb) bt
* thread #1: tid = 0x789d26, 0x00007fff91ba3132 libsystem_c.dylib`strlen + 18, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
* frame #0: 0x00007fff91ba3132 libsystem_c.dylib`strlen + 18
frame #1: 0x000000010000290b emulator`get_key_val(char const*, char const*) + 75
frame #2: 0x000000010000221e emulator`main + 3582
frame #3: 0x00007fff97b255ad libdyld.dylib`start + 1
frame #4: 0x00007fff97b255ad libdyld.dylib`start + 1
7. The above information looks useless. What does the AVD manager say?
# By default mach puts the avds un android-devices, but |android| expects it in $ANDROID_SDK_HOME/.android, so symlink it.
cd $HOME/.mozbuild/android-sdk-macosx/
rmdir avd # Non-existent or empty directory, presumably.
ln -s $HOME/.mozbuild/android-devices/avd .
ANDROID_SDK_HOME=$HOME/.mozbuild/android-sdk-macosx/ $HOME/.mozbuild/android-sdk-macosx/tools/android avd
See screenshot. It shows "Unknown target 'android-18' in /path/to/mozemulator-4.3.ini."
Assignee | ||
Comment 1•8 years ago
|
||
I suspect this is the OSX manifestation of bug 1289226; there are some workarounds documented there.
See Also: → 1289226
Assignee | ||
Updated•8 years ago
|
Assignee: nobody → gbrown
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → DUPLICATE
Updated•5 years ago
|
Product: Firefox for Android → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•