blob: b5a56c0c9a4ca5c90a18cd30e6dd1a38d26c4ef4 [file] [log] [blame]
Rich Slogar40833272014-11-06 17:15:28 -08001page.title=Building and Running Overview
Scott Main50e990c2012-06-21 17:14:39 -07002@jd:body
3
4<div id="qv-wrapper">
Rich Slogar40833272014-11-06 17:15:28 -08005<div id="qv">
6 <h2>See also</h2>
7 <ol>
8 <li><a href="{@docRoot}tools/building/building-studio.html">
9 Building Your Project from Android Studio</a></li>
10 <li><a href="{@docRoot}tools/building/building-cmdline.html">
11 Building Your Project from the Command Line</a></li>
Rich Slogar3bb85fb2015-01-07 13:54:30 -080012 <li><a href="{@docRoot}sdk/installing/studio-build.html">
Rich Slogar40833272014-11-06 17:15:28 -080013 Build System</a></li>
14 </ol>
15</div>
16</div>
Scott Main50e990c2012-06-21 17:14:39 -070017
Scott Main50e990c2012-06-21 17:14:39 -070018
Rich Slogar40833272014-11-06 17:15:28 -080019<p>The Android build process provides project and module build settings so that
20your Android modules are compiled and packaged into <code>.apk</code> files, the containers
21for your application binaries, based on your build settings. The apk file for each app contains all
22of the information necessary to run your application on a device or emulator, such as compiled
23<code>.dex</code> files (<code>.class</code> files converted to Dalvik byte code), a binary version
24of the <code>AndroidManifest.xml</code> file, compiled resources (<code>resources.arsc</code>) and
25uncompiled resource files for your application.</p>
Scott Main50e990c2012-06-21 17:14:39 -070026
Rich Slogar40833272014-11-06 17:15:28 -080027<p>To run an application on an emulator or device, the application must be signed using debug or
28release mode. You typically want to sign your application in debug mode when you develop and test
29your application, because the build system uses a debug key with a known password so you do not have
30to enter it every time you build. When you are ready to release the application to Google
31Play, you must sign the application in release mode, using your own private key.</p>
Scott Main50e990c2012-06-21 17:14:39 -070032
Rich Slogar40833272014-11-06 17:15:28 -080033<p>If you are using Android development tools, the build system can sign the application for you
34when build your app for debugging. You must obtain a certificate to sign your app when you build
35and app for release. For more information on signing applications, see
36<a href="{@docRoot}tools/publishing/app-signing.html">Signing Your Applications</a>.</p>
Scott Main50e990c2012-06-21 17:14:39 -070037
Rich Slogar40833272014-11-06 17:15:28 -080038<p>The following diagram depicts the components involved in building and running an application:</p>
Scott Main50e990c2012-06-21 17:14:39 -070039
Rich Slogar40833272014-11-06 17:15:28 -080040<img src="{@docRoot}images/build-simplified.png" />