Android: 下载、编译android-n-preview-1

没想到google这么早就将android-n-preview-1的代码释放出来了,就乘机下载下来编译看看。

  • 环境:

在ubuntu-14.04 x86_64系统。

  • 下载代码:
$ mkdir -pv /local/n-preview-1 && cd /local/n-preview-1
$ repo init -u https://android.googlesource.com/platform/manifest -b android-n-preview-1
$ repo sync
  • 编译:
$ . build/envsetup.sh
$ lunch aosp_x86-eng
  • 运行:

运行时如果在logcat中出现如下log:

03-14 05:37:13.663  1154  1154 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 1154 (main)
03-14 05:37:13.665  1162  1162 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
03-14 05:37:13.665  1162  1162 F DEBUG   : Build fingerprint: 'Android/aosp_x86/generic_x86:6.0.1/MASTER/hzak03141138:eng/test-keys'
03-14 05:37:13.665  1162  1162 F DEBUG   : Revision: '0'
03-14 05:37:13.665  1162  1162 F DEBUG   : ABI: 'x86'
03-14 05:37:13.665  1162  1162 F DEBUG   : pid: 1154, tid: 1154, name: main  >>> zygote <<<
03-14 05:37:13.665  1162  1162 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
03-14 05:37:13.665  1162  1162 F DEBUG   : Abort message: 'art/runtime/jni_internal.cc:492] JNI FatalError called: frameworks/base/core/jni/com_android_internal_os_Zygote.cpp:566: selinux_android_setcontext failed'
03-14 05:37:13.665  1162  1162 F DEBUG   :     eax 00000000  ebx 00000482  ecx 00000482  edx 00000006
03-14 05:37:13.665  1162  1162 F DEBUG   :     esi b0b6e584  edi b0b6e52c
03-14 05:37:13.665  1162  1162 F DEBUG   :     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000007  xss 0000007b
03-14 05:37:13.665  1162  1162 F DEBUG   :     eip acf2ff86  ebp bfc4e938  esp bfc4e8f0  flags 00000206
03-14 05:37:13.671  1162  1162 F DEBUG   :
03-14 05:37:13.671  1162  1162 F DEBUG   : backtrace:
03-14 05:37:13.671  1162  1162 F DEBUG   :     #00 pc 00078f86  /system/lib/libc.so (tgkill+22)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #01 pc 00074f55  /system/lib/libc.so (pthread_kill+85)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #02 pc 00027cfa  /system/lib/libc.so (raise+42)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #03 pc 0001e136  /system/lib/libc.so (abort+86)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #04 pc 004f79e7  /system/lib/libart.so (art::Runtime::Abort()+423)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #05 pc 00115afc  /system/lib/libart.so (art::LogMessage::~LogMessage()+1292)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #06 pc 003be5c0  /system/lib/libart.so (art::JNI::FatalError(_JNIEnv*, char const*)+176)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #07 pc 00127851  /system/lib/libart.so (art::CheckJNI::FatalError(_JNIEnv*, char const*)+993)
03-14 05:37:13.671  1162  1162 F DEBUG   :     #08 pc 001303ae  /system/lib/libandroid_runtime.so
03-14 05:37:13.671  1162  1162 F DEBUG   :     #09 pc 001318ea  /system/lib/libandroid_runtime.so
03-14 05:37:13.671  1162  1162 F DEBUG   :     #10 pc 0013200a  /system/lib/libandroid_runtime.so
03-14 05:37:13.671  1162  1162 F DEBUG   :     #11 pc 75661e80  /data/dalvik-cache/x86/system@framework@boot-framework.oat (offset 0x1534000)

需要将selinux设为permissive或者disabled:

$ emulator -skin 1280x800 -dynamic-skin -show-kernel -selinux permissive

END

《Android: 下载、编译android-n-preview-1》有2个想法

发表评论

电子邮件地址不会被公开。 必填项已用*标注