1page.title=Development Environment 2@jd:body 3 4<!-- 5 Copyright 2013 The Android Open Source Project 6 7 Licensed under the Apache License, Version 2.0 (the "License"); 8 you may not use this file except in compliance with the License. 9 You may obtain a copy of the License at 10 11 http://www.apache.org/licenses/LICENSE-2.0 12 13 Unless required by applicable law or agreed to in writing, software 14 distributed under the License is distributed on an "AS IS" BASIS, 15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 See the License for the specific language governing permissions and 17 limitations under the License. 18--> 19 20<p>The Trade Federation source is stored in git along with the rest of the Android platform, and 21uses the Android platform build system to create its binary. First and foremost, 22<a href="/source/initializing.html">follow these instructions</a> to set up your machine to be 23able to compile and run things from the Android tree.</p> 24 25<h2>Getting the Source</h2> 26<p>The TF source lives in the Android codebase, but you need to specify an extra option to get at it. 27<a href="/source/downloading.html">Follow these instructions</a> to download the source, but use 28the branch <code>tradefed</code> to actually pull down the Trade Federation source. The actual 29command you run should look something like</p> 30<pre><code>$ repo init -u https://…/manifest -b tradefed</code></pre> 31 32<h3>Building</h3> 33<p>Trade Federation is set up in a lightweight "unbundled" branch that uses slightly different build 34commands from the platform source. In particular, unbundled branches use the <code>tapas</code> 35command to set up the build environment, rather than the <code>lunch</code> command. So starting 36from the root directory of the source tree you checked out, try:</p> 37<pre><code>$ . build/envsetup.sh 38$ tapas tradefed-all 39$ m -j8 40</pre></code> 41 42Note that once the <code>$ . build/envsetup.sh</code> step is done, the other two commands will run 43equally well from anywhere in the tree. 44 45<h2>Running from Command Line</h2> 46<p>First and foremost, tradefed requires the <code>adb</code> utility to be in your current 47<code>$PATH</code>.</p> 48<pre><code>$ export PATH=$PATH:<path to adb></pre></code> 49 50<p>Building TF using the steps mentioned above will add the <code>tradefed.sh</code> launcher script 51to your path. So to launch the TF console, run</p> 52<pre><code>$ tradefed.sh</pre></code> 53 54<p>At this point, your environment is set up for Trade Federation.</p> 55 56