aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html')
-rw-r--r--files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html267
1 files changed, 0 insertions, 267 deletions
diff --git a/files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html b/files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html
deleted file mode 100644
index 8cca33fd04..0000000000
--- a/files/zh-cn/archive/b2g_os/firefox_os_build_prerequisites/index.html
+++ /dev/null
@@ -1,267 +0,0 @@
----
-title: 编译Firefox OS的系统需求
-slug: Archive/B2G_OS/Firefox_OS_build_prerequisites
-translation_of: Archive/B2G_OS/B2G_OS_build_prerequisites
----
-<p style="">在获取用于编译Firefox OS的代码之前,你需要设置好所需的<a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions" title="https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions">编译环境</a>。目前可在64位Linux或Mac OS X下编译Firefox OS。</p>
-<p style=""><span style="background-color: #daa520;">注意:要构建firefox OS到手机上,开始时不要把你的手机连接到电脑上,当需要连接的时候我们会告诉你把手机插入到电脑上。</span></p>
-<h2 id="使用兼容的硬件或使用模拟器" style="">使用兼容的硬件或使用模拟器</h2>
-<p><span id="answer_long0" style="display: block;">尽管我们支持一些手机,其中一些还有多种变体产品,但我们当前支持一些特定的产品而且有些设备比其他的有更好的支持:</span></p>
-<h3 id="等级_1">等级 1</h3>
-<p>等级1设备表示用于开发的主要设备,而且常常会是最先收到漏洞修复和功能更新。</p>
-<dl>
- <dt>
- Unagi</dt>
- <dd>
- Unagi是被用来作为中低端智能手机测试和开发平台的一个手机,许多核心Firefox OS开发者都使用Unagi。</dd>
- <dt>
- Otoro</dt>
- <dd>
- Otoro是被用来作为中低端智能手机测试和开发平台的一个手机,许多核心Firefox OS开发者都使用Otoro。</dd>
- <dt>
- <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Pandaboard" title="/en-US/docs/Mozilla/Boot_to_Gecko/Pandaboard">开发平台Pandaboard</a></dt>
- <dd>
- Pandaboard是一个基于OMAP(开放式多媒体应用平台,Open Multimedia Application Platform)4架构的开发用电路板,用于移动平台上的开发工作。</dd>
- <dt>
- <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators" title="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators">模拟器(ARM和x86)Emulator (ARM and x86)</a></dt>
- <dd>
- 有两种可用的模拟器:一个模拟ARM代码(指令集),而另一个运行在x86代码(指令集)上。</dd>
- <dt>
- <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client" title="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client">桌面</a></dt>
- <dd>
- 你也可以构建Firefox OS的桌面版本;这种方式在<a href="/en-US/docs/XULRunner" title="/en-US/docs/XULRunner">XULRunner</a>应用中运行<a href="/en-US/docs/Gecko" title="/en-US/docs/Gecko">Gecko</a>,接着你就可以在其中使用<a href="/en-US/docs/Mozilla/Boot_to_Gecko/Introduction_to_Gaia" title="/en-US/docs/Mozilla/Boot_to_Gecko/Introduction_to_Gaia">Gaia</a>用户界面了。</dd>
-</dl>
-<p>当然,你也可以构建<a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client" title="en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_desktop_client">桌面客户端</a>或者使用<a href="/en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators" title="en-US/docs/Mozilla/Boot_to_Gecko/Using_the_B2G_emulators">模拟器</a>。</p>
-<h3 id="等级2">等级2</h3>
-<p><span id="answer_long1" style="display: block;">等级2设备为一般功能性设备,许多开发者(特别是应用开发者)都是用这样的设备,所以他们往往在之后选择更新。</span></p>
-<dl>
- <dt>
- <a href="/en-US/docs/Mozilla/Firefox_OS/Samsung_Nexus_S" title="/en-US/docs/Mozilla/Firefox_OS/Samsung_Nexus_S"><span class="link-https">Samsung Nexus S</span></a></dt>
- <dd>
- 已知的Nexus S设备中可用的产品型号为GT-I9020A和GT-I9023,其他型号也许可以用。</dd>
- <dt>
- Samsung Nexus S 4G</dt>
- <dd>
- SPH-D720作为等级2设备支持。</dd>
-</dl>
-<h3 id="等级3">等级3</h3>
-<p><span id="answer_long1" style="display: block;">Firefox OS可以在这些设备上构建,但是他们并不是核心开发者积极工作的基础设备。他们的可靠性和功能设置可能会明显的落后于等级1设备甚至于等级2设备。</span></p>
-<dl>
- <dt>
- Samsung Galaxy S2</dt>
- <dd>
- 唯一可用的产品型号是i9100;没有其他的同类型变体具有官方兼容性。(i9100P可能可用,因为它唯一的改变是增加了一个NFC芯片)</dd>
- <dt>
- Samsung Galaxy Nexus</dt>
- <dd>
- 现在所知的没有任何变体产品可以兼容。</dd>
-</dl>
-<div class="warning">
- <strong>重点:</strong> 仅支持至少运行<strong>Android 4</strong>(又称<strong>Ice Cream Sandwich</strong>)的设备,如果你的设备在上面列出来了,但是运行的是低版本的安卓系统,请先升级在进行操作。</div>
-<h2 id="Linux系统需求" style="">Linux系统需求</h2>
-<p>在Linux系统下构建Firefox OS,要求如下:</p>
-<p>To build on Linux, you'll need to have a system configured with:</p>
-<ul>
- <li>An installed <strong>64 bit GNU/Linux</strong> distribution (we recommend Ubuntu 12.04).安装64位GNU/Linux发行版(我们推荐Ubuntu12.04)</li>
- <li>At least <strong>4 GB</strong> of RAM/swap space.(至少有4GB内存或交换分区空间)</li>
- <li>At least <strong>20 GB</strong> of available hard disk space.(至少有20GB的空白硬盘空间)</li>
-</ul>
-<p>This is more than the bare minimum, but sometimes building fails just because it's missing resources.【这已经超过最低限度,但是有时构建失败只是因为缺少资源】</p>
-<p>It's possible to use other distributions, but we recommend Ubuntu 12.04 since it's the most common system people use successfully. Distributions that <strong>might not work</strong>: <strong>32 bit</strong> distros and recent distros ( <strong>Ubuntu 12.10, Fedora 17/18, Arch Linux</strong> because of <strong>gcc 4.7</strong>).【可以使用其他发行版本,但是我们建议使用Ubuntu 12.04,因为他是人们成功使用最常用的。可能无法正常工作的发行版有:32位和最近发型版本(Ubuntu 12.10,Fedora 17/18,因为linux分支gcc 4.7-可能版本过高吧)】</p>
-<p>You will also need the following tools installed:</p>
-<p>【你还需要安装一下工具:】</p>
-<ul>
- <li><strong>autoconf 2.13</strong></li>
- <li><strong>bison</strong></li>
- <li><strong>bzip2</strong></li>
- <li><strong>ccache</strong></li>
- <li><strong>curl</strong></li>
- <li><strong>flex</strong></li>
- <li><strong>gawk</strong></li>
- <li><strong>git</strong></li>
- <li><strong>gcc / g++ / g++-multilib</strong> <strong>(4.6.3 or older)</strong></li>
- <li><strong>make</strong></li>
- <li><strong>OpenGL headers</strong></li>
- <li><strong>X11 headers</strong></li>
- <li><strong>32-bit ncurses</strong></li>
- <li><strong>32-bit zlib</strong></li>
-</ul>
-<h3 id="64_bit_install_examples"><strong>64 bit install examples:</strong></h3>
-<p><strong>Ubuntu 12.04 / Linux Mint 13 / Debian 6</strong></p>
-<pre>$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip</pre>
-<p class="note">When building on 64-bit Ubuntu, you may find that you need to add symlinks for the 32-bit versions of <code>libX11.so</code> and <code>libGL.so</code>:</p>
-<pre class="note">$ sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so
-$ sudo ln -s /usr/lib/i386-linux-gnu/mesa/libGL.so.1 /usr/lib/i386-linux-gnu/libGL.so</pre>
-<p><strong>Ubuntu 12.10</strong></p>
-<pre>$ sudo apt-get install autoconf2.13 bison bzip2 ccache curl flex gawk gcc g++ g++-multilib gcc-4.6 g++-4.6 g++-4.6-multilib git ia32-libs lib32ncurses5-dev lib32z1-dev libgl1-mesa-dev libx11-dev make zip</pre>
-<p class="note">In addition to the steps above needed to fix issues with the 32-bit versions of the <code>libX11.so</code> and <code>libGL.so</code> libraries, you will need to specify GCC 4.6 as the default host compiler before building. After having retrieved the sources, see <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler" title="en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler">here</a> how to do it.</p>
-<p class="note">In a fresh Ubuntu 12.10 install, you'll get an error about unmet dependenceis for ia32-libs. The following steps fix it.</p>
-<pre>sudo dpkg --add-architecture i386
-sudo apt-get update
-sudo apt-get install ia32-libs</pre>
-<p><strong>Fedora 16:</strong></p>
-<pre class="note">$ sudo yum install autoconf213 bison bzip2 ccache curl flex gawk gcc-c++ git glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel patch zlib-devel ncurses-devel.i686 readline-devel.i686 zlib-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip</pre>
-<p><strong>Fedora 17/18:</strong></p>
-<pre class="note">$ sudo yum install autoconf213 bison bzip2 ccache curl flex gawk gcc-c++ git glibc-devel glibc-static libstdc++-static libX11-devel make mesa-libGL-devel ncurses-devel patch zlib-devel ncurses-devel.i686 readline-devel.i686 zlib-devel.i686 libX11-devel.i686 mesa-libGL-devel.i686 glibc-devel.i686 libstdc++.i686 libXrandr.i686 zip perl-Digest-SHA</pre>
-<p>In addition to the above you will need GCC 4.4 in order to compile the project. You can find a pre-compiled version <a href="http://people.mozilla.org/~gsvelto/gcc-4.4.7-bin.tar.xz">here</a>. Download it and install it to <code>/opt</code> with the following command:</p>
-<pre class="note">$ wget http://people.mozilla.org/~gsvelto/gcc-4.4.7-bin.tar.xz
-$ sudo tar -x -a -C /opt -f gcc-4.4.7-bin.tar.xz
-</pre>
-<p>You will need to specify this compiler as the default host compiler before building. After having retrieved the sources, see <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler" title="en-US/docs/Mozilla/Boot_to_Gecko/Customization_with_the_.userconfig_file#Changing_the_default_host_compiler">here</a> how to do it.</p>
-<p> </p>
-<p><strong>Arch Linux (not functional yet):</strong></p>
-<pre class="note">$ sudo <span style=""><span style="">pacman -S --needed </span></span><span style=""><span style="">alsa-lib </span></span><span style=""><span style="">autoconf2.13</span></span><span style=""><span style=""> bison</span></span><span style=""><span style=""> ccache</span></span><span style=""><span style=""> </span></span><span style=""><span style="">curl firefox </span></span><span style=""><span style="">flex </span></span><span style=""><span style="">gcc-multilib </span></span><span style=""><span style="">git </span></span><span style=""><span style="">gperf </span></span><span style=""><span style="">libnotify </span></span><span style=""><span style="">libxt </span></span><span style=""><span style="">libx11 mesa multilib-devel </span></span><span style=""><span style="">wireless_tools </span></span><span style=""><span style="">yasm</span></span><span style=""><span style=""> </span></span><span style=""><span style="">lib32-mesa </span></span><span style=""><span style="">lib32-ncurses lib32-readline</span></span><span style=""><span style=""> </span></span><span style=""><span style="">lib32-zlib</span></span></pre>
-<p>By default, Arch Linux uses Python3. You'll have to force it to use the old python2:</p>
-<pre><span style=""><span style="">$ cd /usr/bin</span></span>
-
-<span style=""><span style="">$ sudo ln -fs python2 python</span></span></pre>
-<h2 id="Mac_OS_X系统需求" style="">Mac OS X系统需求</h2>
-<p>To build Firefox OS on Mac OS X, you need to install Xcode's Command Line Utilities.</p>
-<p>You can download <em>just</em> the Command Line Utilities from <a href="https://developer.apple.com/downloads/" title="https://developer.apple.com/downloads/">Apple's developer downloads page</a> for your particular version of OS X.</p>
-<p>However, if you would like the entire Xcode suite of applications, you can <a class="external" href="http://itunes.apple.com/us/app/xcode/id497799835?mt=12" style="line-height: 1.572;" title="http://itunes.apple.com/us/app/xcode/id497799835?mt=12">install Xcode</a><span style="line-height: 1.572;"> through the Mac App Store. </span></p>
-<p><strong>Install Command Line Utilities via XCode 4.3.1 and newer</strong></p>
-<p>Xcode 4.3.1 (OS X 10.7 "Lion") and other newer versions such as 4.4.1+ (that is, Mac OS X10.8 "Mountain Lion"), won't necessarily include the required Command Line Utilities. When you install Xcode, make sure to go into Preferences, then the Downloads panel, and install the Command Line Utilities. In addition, make sure you have at least 20 GB of free disk space.</p>
-<p><img alt="Screenshot of Xcode Downloads Command Line Tools" src="/files/4557/xcode_downloads_command_line_tools.png" style="width: 750px; height: 528px;"></p>
-<div class="note">
- <strong>Note:</strong> The Firefox OS emulator requires a Core 2 Duo processor or later; that is, a system that is compatible with Mac OS X 10.7 "Lion." You do not actually have to be running Lion, you just have to be compatible with it. You can, however, build any Firefox OS build on many older Macs.</div>
-<p><font face="Georgia, Times, Times New Roman, serif"><span style="font-size: 20px; line-height: 31px;"><b>Firefox OS Mac Bootstrap</b></span></font></p>
-<p>Open a terminal and run the following command:</p>
-<pre class="brush: bash">curl -fsSL https://raw.github.com/mozilla-b2g/B2G/master/scripts/bootstrap-mac.sh | bash</pre>
-<p>It will pull and run a bootstrap script that makes sure you have all the prerequisites met to build the emulator. It will also prompt you for permission to install anything you're missing. The script will check for and install the following items:</p>
-<ul>
- <li><code>git</code></li>
- <li><code>gpg</code></li>
- <li><code>ccache</code></li>
- <li><code>yasm</code></li>
- <li><code>autoconf-213</code></li>
- <li><code>gcc-4.6</code></li>
- <li><code>homebrew</code></li>
-</ul>
-<div>
- <p>Xcode</p>
- <p>If you have already upgraded to Xcode 4.4+ and get the message that Xcode is outdated, check the Xcode path with:</p>
- <pre>xcode-select -print-path</pre>
- If it still points to <code>/Developer</code> you can update the path with:
- <pre>sudo xcode-select -switch /Applications/Xcode.app</pre>
- Next to that be sure that you have the Mac OS X 10.6 SDK available at:
- <pre>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/</pre>
- <p>If it cannot be found there you will need to extract and copy it from the Xcode 4.3 DMG file which is available at the <a class="external" href="https://developer.apple.com/downloads/index.action">Apple Developer</a> portal. You can use the utility Pacifist to extract the 10.6 SDK. Be sure to add a symlink to it to the <code>/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/</code> directory. (We can drop the 10.6 SDK requirement after <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=784227" title="https://bugzilla.mozilla.org/show_bug.cgi?id=784227">bug 784227</a> has been fixed, and our version of <a href="https://github.com/mozilla-b2g/B2G/issues/189" title="https://github.com/mozilla-b2g/B2G/issues/189">platform_build has been updated</a>.)</p>
- <h3 id="Mountain_Lion">Mountain Lion</h3>
- <div>
- <p>If you are building on OS X 10.8 "Mountain Lion" (Xcode 4.4.1 or later) and encounter the following error:</p>
- <pre style="font-size: 14px;">external/qemu/android/skin/trackball.c:130:25: error: 'M_PI' undeclared (first use in this function)</pre>
- Edit the file: <code style="font-size: 14px;">B2G/external/qemu/Makefile.android</code> and add in line 78:<br>
- <pre style="font-size: 14px;">MY_CFLAGS += -DM_PI=3.14159265358979323846264338327950288   #/* B2G_fix: not finding M_PI constant */
-</pre>
- <div>
- If you are on Mountain Lion and you receive an error during the installation of the dependencies via homebrew, such as:</div>
- </div>
-</div>
-<div>
- <pre>clang: error: unable to execute command: Segmentation fault: 11</pre>
- ... try reinstalling the dependency manually adding the --use-gcc flag, for example:
- <pre>brew install mpfr --use-gcc</pre>
-</div>
-<h3 id="Samsung_Galaxy_S2">Samsung Galaxy S2</h3>
-<p>If you plan to build for the Samsung Galaxy S2, you will also need to install heimdall. See <a href="#Installing_heimdall">Installing heimdall</a> for details. This is <strong>not</strong> done for you by the bootstrap script!</p>
-<div class="note">
- <strong>Note:</strong> If you have installed the <a class="external" href="http://www.samsung.com/us/kies/" title="http://www.samsung.com/us/kies/">Samsung Kies</a> tool, which is used to manage the contents of many Samsung phones, you will have to remove it before you can flash Firefox OS onto your device. You can use the standard application removal process on Windows; on Mac, the Kies install disk image has a utility to fully remove Kies from your system. Flashing <strong>will not work</strong> if you have Kies installed. If you forget to remove Kies, the build system will detect it and remind you to uninstall it. Note also that the uninstall tool does not correctly remove the folder <code>~/Library/Application Support/.FUS</code>, and leaves a reference to a utility there in your user startup items list. You will want to remove these manually.</div>
-<div class="note">
- <strong>Note:</strong> Mac OS X uses a case insensitive filesystem by default, which will prevent you from building Firefox OS down the road (<strong>EDITOR'S NOTE: I have never had a problem with this)</strong>.  You should create a case sensitive sparse disk image work from within that directory.  To buld the case sensitive disk image:</div>
-<pre>hdiutil create -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 40g ~/firefoxos.dmg</pre>
-<p>Mount the drive with:</p>
-<pre>open ~/firefoxos.dmg</pre>
-<p>Change into the mouted drive with:</p>
-<pre>cd /Volumes/untitled/</pre>
-<h3 class="note" id="Fix_libmpc_dependency_if_broken">Fix libmpc dependency if broken</h3>
-<p>gcc 4.6 was built with libmpc 0.9; if you then use homebrew to update packages, libmpc gets updated to version 1.0, but homebrew doesn't rebuild gcc 4.6 after the library version changes. So you need to create a symlink to make things work again, like this:</p>
-<pre>cd /usr/local/lib/
-ln -s libmpc.3.dylib libmpc.2.dylib</pre>
-<h3 id="Optional_Install_HAX">Optional: Install HAX</h3>
-<p>Intel provides a special driver that lets the B2G emulator run its code natively on your Mac instead of being emulated, when you're using the x86 emulator. If you wish to use this, you can <a class="external" href="http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/" title="http://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager/">download and install</a> it. It's not required, but it can improve emulation performance and stability.</p>
-<h2 class="note" id="安装adb">安装adb</h2>
-<p>在构建B2G之前,需要从手机的安卓安装上拷贝下来二进制对象(当然,除非你要构建模拟器)。为此,你需要安装adb,安卓调试桥(Android Debug Bridge)。<a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Installing_ADB">安装adb</a>这篇文件中讲解了如何安装adb。</p>
-<div class="warning">
- <p>在你将来使用adb时请注意:为了调试你的手机,adb需要手机的锁屏处于解锁状态(至少在最新的Firefox OS中是这样的)。你最好禁用锁屏(我们在以后的构建指导中说明如何来做)。</p>
-</div>
-<h2 class="note" id="安装heimdall">安装heimdall</h2>
-<p>Heimdall is a utility for flashing the Samsung Galaxy S2. It's used by the Boot to Gecko flash utility to replace the contents of the phone with Firefox OS, as well as to flash updated versions of B2G and Gaia onto the device. You'll need it if you want to install Firefox OS on a Galaxy S2; it is <strong>not</strong> needed for any other device. For other devices, we build and use the fastboot utility instead.</p>
-<div class="note">
- <strong>Note:</strong> Again, it's important to note that this is <strong>only required for installing Firefox OS on the Samsung Galaxy S2</strong>.</div>
-<p>There are two ways to install heimdall:</p>
-<ul>
- <li>You can <a class="link-https" href="https://github.com/Benjamin-Dobell/Heimdall" title="https://github.com/Benjamin-Dobell/Heimdall">download the code</a> GitHub and build it yourself.</li>
- <li>Use a package manager to install it.
- <ul>
- <li>On Linux: <code>sudo apt-get install libusb-1.0-0 libusb-1.0-0-dev</code></li>
- <li>On Mac, you can <a class="link-https" href="https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-suite-1.3.2-mac.dmg" title="https://github.com/downloads/Benjamin-Dobell/Heimdall/heimdall-suite-1.3.2-mac.dmg">download an installer package</a> and use that.</li>
- </ul>
- </li>
-</ul>
-<div class="note">
- <p><strong>Note</strong>: Building the latest Heimdall from source currently produces errors. It is better to instead use the 64bit packaged version from the Ubuntu 14.04 repos. i.e. don't use heimdall-flash:i386 if you can avoid it.</p>
-</div>
-<h2 id="配置_ccache">配置 ccache</h2>
-<p>B2G构建过程使用ccache,ccache的默认缓存大小是1GB,但是B2G构建很容易就会占满这个缓存;建议把缓存调整到10G左右。你可以通过在终端中运行下面这个命令来配置你的缓存:</p>
-<pre class="language-html"><code class="language-html">ccache --max-size 10GB</code></pre>
-<h2 id="针对Linux:为你的手机配置udev_规则">针对Linux:为你的手机配置udev 规则</h2>
-<div class="note">
- <p><strong>注意</strong>: 这一节是针对Linux用户;OS X用户已经安装了必要的设备权限。</p>
-</div>
-<p>接下来,你需要为你的手机配置udev规则。</p>
-<p>你可以通过运行<code>lsusb来获得你插入的手机的</code> <a href="https://developer.android.com/tools/device.html#VendorIds">USB供应商编号(USB vendor ID)</a> ,通常是Google <code>18d1,</code> Samsung <code>04e8</code>, ZTE <code>19d2</code>, Geeksphone/Qualcomm <code>05c6。</code></p>
-<p>在文件<code>/etc/udev/rules.d/android.rules中加上这一行(使用你的设备供应商ID替换XXXX):</code></p>
-<pre class="language-html"><code class="language-html">SUBSYSTEM=="usb", ATTR{idVendor}=="XXXX", MODE="0666", GROUP="plugdev"</code></pre>
-<p>以中兴手机作为例子,android.rules的内容如下:</p>
-<pre class="language-html" style="font-size: 14px;"><code class="language-html">SUBSYSTEM=="usb", ATTR{idVendor}=="19d2", MODE="0666", GROUP="plugdev"</code></pre>
-<p>对于Firefox Flame,内容如下:</p>
-<pre class="language-html" style="font-size: 14px;"><code class="language-html">SUBSYSTEM=="usb", ATTR{idVendor}=="05c6", MODE="0666", GROUP="plugdev"</code></pre>
-<p>请注意fastboot设备(flash时使用)可能有一个不同的供应商ID(vendor ID),故你需要为它添加一条规则。例如Firefox Flame也需要谷歌的供应商ID</p>
-<pre class="language-html" style="font-size: 14px;"><code class="language-html">SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"</code></pre>
-<div class="note">
- <p><span style="line-height: 1.572;">如果文件不存在则创建,<span style="line-height: 1.572;"><code>通常,rules.d目录默认为只读,所以你可能要使用<span style="line-height: 1.572;"><code>chmod来使目录、文件或两者可写。</code></span></code></span></span></p>
-</div>
-<p><span style="line-height: 1.572;">一旦你保存了文件就关闭它,让文件可读:</span></p>
-<pre class="language-html"><code class="language-html">sudo chmod a+r /etc/udev/rules.d/android.rules</code></pre>
-<p>由于udev规则更新了,重启udev守护进程。</p>
-<p><strong>Ubuntu</strong></p>
-<pre class="language-html"><code class="language-html">sudo service udev restart</code></pre>
-<p><strong>Fedora 20</strong></p>
-<pre class="language-html"><code class="language-html">sudo systemctl restart systemd-udevd.service</code></pre>
-<p><strong>ARCH</strong></p>
-<pre class="language-html"><code class="language-html">sudo udevadm control --reload-rules</code></pre>
-<div class="note">
- <p><strong>注意</strong>: 这也许需要稍长的时间,取决于你的发行版本,类似于:<br>
- <br>
- <code>sudo vi /etc/udev/rules.d/android.rules<br>
- sudo service udev restart<br>
- sudo /etc/init.d/udev restart<br>
- sudo reload udev<br>
- sudo udevadm trigger</code></p>
-</div>
-<p>最后,拔掉USB接口但是不要重新插上,因为我们要先启动手机上的远程调试。</p>
-<h2 id="启动远程调试">启动远程调试</h2>
-<p>在你把你的手机插回USB端口上之前,让其处于USB开发者模式,这允许你调试并更新(flash)你的手机,在你的手机上启动<a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Developer_settings">开发者设置</a> 中的 <a href="https://developer.mozilla.org/en-US/Firefox_OS/Debugging/Developer_settings#Remote_debugging">远程调试</a>(在老版本中称为开发者模式)来启动开发者模式。一旦勾选了这个选项,远程调试即启动,然后你就可以继续了。</p>
-<p>现在,通过USB连接你的手机和电脑(如果你在之前创建了一个udev规则,这将会触发udev检测你的手机并创建相应权限的设备节点)。现在你可以检查你是否可以通过<code>adb devices命令来列出你的设备(谨记adb只可以在你的手机处于解锁时看到它)。如果一切OK,你应该可以看到类似于下面的输出(下面这个是对于一个极客手机Keon来说):</code></p>
-<pre class="language-html" style="font-size: 14px;"><code class="language-html">$ adb devices
-List of devices attached
-full_keon device</code></pre>
-<p>如果设备没有列出来,检查文件名称和脚本是否正确(详见之前的小节),然后重启电脑并重新输入命令,还要注意你的设备是否使用fastboot,引导程序可能会识别为一个不同的供应商ID而不是你正常用设备引导看到的那个。</p>
-<h2 id="备份手机system分区">备份手机system分区</h2>
-<div class="note">
- <p><strong>注意</strong>: 如果你没有已存在的系统备份,在构建系统之前你必须做这一步,因为在构建期间有许多库会被引用,这些库可能是专有的以至于我们不能在基础代码中提供他们。</p>
-</div>
-<p>建议你备份手机上的整个安卓系统分区。</p>
-<p>你可以使用这份安卓二进制对象副本,以防后面你会删除你的B2G树,运行:</p>
-<pre class="language-html"><code class="language-html">adb pull /system <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>backup</span> <span class="token attr-name">target</span> <span class="token attr-name">dir</span><span class="token punctuation">&gt;</span></span>/system</code></pre>
-<p> 你可能还需要拷贝出<code>/data</code> 和/或 <code>/vendor</code>目录,不过这取决于手机:</p>
-<pre class="language-html"><code class="language-html">adb pull /data <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>backup</span> <span class="token attr-name">target</span> <span class="token attr-name">dir</span><span class="token punctuation">&gt;</span></span>/data
-adb pull /vendor <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>backup</span> <span class="token attr-name">target</span> <span class="token attr-name">dir</span><span class="token punctuation">&gt;</span></span>/vendor</code></pre>
-<p>如果pull命令因“权限不足”而失败,尝试下面的步骤:</p>
-<ul>
- <li>停止并重启adb服务器</li>
- <li>确保在你自定义的ROM中你有<code>adb工具的root权限(比如:在桌面时钟(CyanogenMod)下,改变</code><em>设置 &gt; 系统 &gt; 开发者选项 &gt; 赋予应用和ADB root权限</em> or 仅仅是ADB)</li>
- <li>确定你已经正确设置了udev规则</li>
-</ul>
-<h2 id="On_to_the_next_step">On to the next step</h2>
-<p>At this point, you should be ready to <a href="/en-US/docs/Mozilla/Boot_to_Gecko/Preparing_for_your_first_B2G_build" title="en-US/docs/Mozilla/Boot_to_Gecko/Preparing_for_your_first_B2G_build">fetch the Firefox OS code</a>!</p>