這一篇補充說明主頁上有關構建和運行中運行在特殊設備上的信息。
通過當前已經(jīng)發(fā)放的版本,可以在 Nexus 4,Nexus 7 以及一些 Galaxy Nexus 的變異版本的手機上構建。每一個設備的具體實用性水平,取決于硬件所屬的二進制文件。
給 Nexus 4 和 Nexus 7,所有的配置都可以使用,并且所有的硬件都可以工作。由于硬件的不同,不要在 Nexus 7 上使用 4.1.1,它已經(jīng)被 4.1.2 以及后續(xù)的版本所取代。
所有的 Nexus 10 “manta” 配置可以使用 4.2.2。在這些設備上,圖像,音頻,Wi-Fi,藍牙,照相機,NFC,GPS 和定向的感應器都可以運行。
Galaxy Nexus 變異版本可以使用的是 GSM/HSPA+ “maguro” 配置(只有在它已經(jīng)被 “yakju” 或者 “takju” 操作系統(tǒng)所替代),以及 VZW CDMA/LTE "toro" 配置。在這些設備上,圖形和視頻可以生效,和 Wi-Fi,藍牙一樣,它們都通過各自的細胞網(wǎng)絡連接。NFC 和方向感應器也可以工作。
Galaxy Nexus 在 jb-mr1-dev-plus-aosp 分支上實驗性的通過 Sprint CDMA/LTE 配置信息 “toroplus”。在此配置中,細胞網(wǎng)絡并不能正常工作,其他的功能像他們在 “toro” 中一樣的工作。
使用 Android 4.1.2,Motorola Xoom 可以用在產(chǎn)于美國的 Wi-Fi 配置 “wingray“。圖形,音頻, Wi-Fi 和藍牙以及方向感應都可以正常工作。
所有 Nexus S 和 Nexus S 4G 的配置都可以用于 Android 4.1.2 上。在這些設備上,所有的硬件都可以正常的工作。
此外,PandaBoard a.k.a ”panda“ 可以被用在 jb-mr1-dev-plus-aosp 分支上,但是僅僅是理論上可行。具體如何通過Android 開源工程來使用 PandaBoard,在資源樹中的 device/ti/panda/README 中查看。
如果你還沒有安裝好這些工具,fastboot 和 adb 可以通過一般的 build 系統(tǒng)來構建。按照網(wǎng)頁中有關Build and Running的信息,替換掉主要的 make 命令,改為一下的命令:
$ make fastboot adb
通過冷啟動,下面核心的組合可以被用來進入 fastboot 模式,這是一個在 bootloader 中的一種模式,可以被用來啟動設備:
| Devices | Keys |
|---|---|
| shamu | Press and hold Volume Down, then press and hold Power |
| fugu | Press and hold Power |
| volantis | Press and hold Volume Down, then press and hold Power |
| hammerhead | Press and hold both Volume Up and Volume Down, then press and hold Power |
| flo | Press and hold Volume Down, then press and hold Power |
| deb | Press and hold Volume Down, then press and hold Power |
| manta | Press and hold both Volume Up and Volume Down, then press and hold Power |
| mako | Press and hold Volume Down, then press and hold Power |
| grouper | Press and hold Volume Down, then press and hold Power |
| tilapia | Press and hold Volume Down, then press and hold Power |
| phantasm | Power the device, cover it with one hand after the LEDs light up and until they turn red |
| maguro | Press and hold both Volume Up and Volume Down, then press and hold Power |
| toro | Press and hold both Volume Up and Volume Down, then press and hold Power |
| toroplus | Press and hold both Volume Up and Volume Down, then press and hold Power |
| panda | Press and hold Input, then press Power |
| wingray | Press and hold Volume Down, then press and hold Power |
| crespo | Press and hold Volume Up, then press and hold Power |
| crespo4g | Press and hold Volume Up, then press and hold Power |
同樣的,命令 adb reboot bootloader 可以被用于直接重啟 Android 進入 bootloader 模式,并且不需要核心組合。
只有 bootloader 允許才能刷入客戶端。
默認情況下 bootloader 是上鎖的。在設備處于 fastboot 模式下,bootloader 可以這么解鎖:
$ fastboot oem unlock
程序必須確認在屏幕上,并且出于隱私原因將會刪除用戶數(shù)據(jù)。這只需要執(zhí)行一次即可。
所有數(shù)據(jù)都被刪除,也就是說不僅僅是應用程序的私有數(shù)據(jù),還包括那些可以通過 USB 輕易獲取的公共數(shù)據(jù),其中包含照片和電影,都會被刪除。請在解鎖 bootloader 之前,確認重要的數(shù)據(jù)是否都做了備份。
在 Nexus 10 上,解鎖 bootloader 之后內置的存儲被置于未格式化的狀態(tài),所以必須通過下面的命令格式化:
$ fastboot format cache
$ fastboot format userdata
bootloader 可以通過下面的命令進行加鎖
$ fastboot oem lock
注意,這會清除用戶在 Xoom 上的數(shù)據(jù)(包括 USB 共享數(shù)據(jù))
Android 開源工程不能單單從純粹的源碼中使用,而且還必須通過硬件廠商的連接庫才能運行,特別是那些具有硬件圖像加速功能的手機。
官方提供給支持的設備的二進制文件被標以 AOSP 標簽免費版本,是可以從 中下載的。這些用不開源的代碼,增加了額外的硬件能力。安裝構建 AOSP 當前分支,請使用 Binaries Preview for Nexus Devices。
當給一個設備創(chuàng)建 master 分支時,大多數(shù)被標記發(fā)放或者多數(shù)不久之前的二進制數(shù)據(jù)應該是可以被使用的。
每一個特定的二進制數(shù)據(jù),都會通過一個自取腳本,從壓縮的文檔中獲取。解壓縮每一個文件,從資源樹的根目錄中,運行包括自取腳本,確認你同意封閉許可協(xié)議,之后二進制文件以及他們的匹配文件將會在資源樹的 vendor/ 層中安裝。
為了確保取出后的二進制數(shù)據(jù)正確的添加進賬號,之前已經(jīng)存在對外輸出的構建必須像這樣刪除:
$ make clobber
匹配和構建 Android 開源工程的步驟被寫在了 Building上。
通過登錄菜單,給大多數(shù)設備推薦的 builds,當運行無參數(shù) lunch 命令時是可以運行的。適配 Nexus 的工廠圖片和二進制數(shù)據(jù)可以在這里下載:
https://developers.google.com/android/nexus/images
https://developers.google.com/android/nexus/drivers
| Device | Code name | Build configuration |
|---|---|---|
| Nexus 6 | shamu | aosp_shamu-userdebug |
| Nexus Player | fugu | aosp_fugu-userdebug |
| Nexus 9 | volantis (flounder) | aosp_flounder-userdebug |
| Nexus 5 (GSM/LTE) | hammerhead | aosp_hammerhead-userdebug |
| Nexus 7 (Wi-Fi) | razor (flo) | aosp_flo-userdebug |
| Nexus 7 (Mobile) | razorg (deb) | aosp_deb-userdebug |
| Nexus 10 | mantaray (manta) | full_manta-userdebug |
| Nexus 4 | occam (mako) | full_mako-userdebug |
| Nexus 7 (Wi-Fi) | nakasi (grouper) | full_grouper-userdebug |
| Nexus 7 (Mobile) | nakasig (tilapia) | full_tilapia-userdebug |
| Galaxy Nexus (GSM/HSPA+) | yakju (maguro) | full_maguro-userdebug |
| Galaxy Nexus (Verizon) | mysid (toro) | aosp_toro-userdebug |
| Galaxy Nexus (Experimental) | mysidspr (toroplus) | aosp_toroplus-userdebug |
| PandaBoard (Archived) | panda | aosp_panda-userdebug |
| Motorola Xoom (U.S. Wi-Fi) | wingray | full_wingray-userdebug |
| Nexus S | soju (crespo) | full_crespo-userdebug |
| Nexus S 4G | sojus (crespo4g) | full_crespo4g-userdebug |
不要在 Nexus 7 上使用 4.1.1,此機型只能使用 4.1.2 或更高版本。
如果有必要請將設備設置成 fastboot 模式(詳情請看上文)。
一個完整的 Android 系統(tǒng)可以用一條命令來給設備刷入一個系統(tǒng):在經(jīng)過核對被寫入的系統(tǒng)已經(jīng)成功的和已經(jīng)安裝過的 bootloader,廣播之間可以相互協(xié)作后,會將啟動,修復,系統(tǒng)三個部分寫在一塊,最后重啟系統(tǒng)。這樣的操作也會清楚用戶數(shù)據(jù),就跟之前在 fastboot oem unlock 中提到的差不多。
$ fastboot -w flashall
需要注意的是,在 Motorola Xoom 上,文件系統(tǒng)創(chuàng)建出的 via fastboot 并不會良好的工作,并且強烈推薦用下面的命令重建它:
$ adb reboot recovery
一旦進入回復,打開菜單(按下電源和音量+),清除緩存部分,之后清除數(shù)據(jù)。
Nexus 5,Nexus 10,Nexus 4,Nexus Q,Nexus 7,Galaxy Nexus (GSM/HSPA+ "yakju" 和 "takju", 和 CDMA/LTE "mysid" 以及 "mysidspr"),Nexus S 和 Nexus S 4G 的出廠圖片,都可以在頁面下載。
Motorola Xoom 的工廠圖片則直接通過 Motorola 發(fā)布。