- Actually, we don't support GeckoView build on Apple Sillicon simply yet. Although Rust has native binaries, we have to use some x86_64 tools for clang, OpenJDK and Python 2.7.
- You can use https://github.com/google/android-emulator-m1-preview on macOS. But
./mach install
doesn't detect this emulator now. - GV's unit tests doesn't work yet.
- Set up development environment via https://bit.ly/36bUmEx
- Install OpenJDK (macOS x86_64) since it has no aarch64 packages.
- Add your rust target like aarch64-linux-android via
rustup target add aarch64-linux-android
- Comment out https://searchfox.org/mozilla-central/rev/c8ce16e4299a3afd560320d8d094556f2b5504cd/python/mozboot/mozboot/osx.py#197 like "
# sys.exit(1)
" - Run
./mach bootstrap --no-system-changes
to install GV's build tools. - Add the following lines on your mozconfig
ac_add_options --with-android-toolchain=$HOME/.mozbuild/android-ndk-r21d/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64
ac_add_options --with-android-lldb-server=$HOME/.mozbuild/android-ndk-r21d/toolchains/llvm/prebuilt/darwin-x86_64/lib64/clang/9.0.8/lib/linux/aarch64/lldb-server
ac_add_options --with-libclang-path=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib
- Run
./mach build
./mach install
doesn't work yet. But you can use adb commaned to install binary like adb install objdir/gradle/build/mobile/android/geckoview_example/outputs/apk/withGeckoBinaries/debug/geckoview_example-withGeckoBinaries-debug.apk
.
Actually, Android emulator path isn't <Android SDK>/emulator
now, you cannot use any unittests and we don't have aarch64 test image now.
If you set HOST_CC
and HOST_CXX
to Xcode's clang, it requries -m
to link additional libm. Don't use xcode's clang.