| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 1 | page.title=Building and Running Overview |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 2 | @jd:body |
| 3 | |
| 4 | <div id="qv-wrapper"> |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 5 | <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 Slogar | 3bb85fb | 2015-01-07 13:54:30 -0800 | [diff] [blame] | 12 | <li><a href="{@docRoot}sdk/installing/studio-build.html"> |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 13 | Build System</a></li> |
| 14 | </ol> |
| 15 | </div> |
| 16 | </div> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 17 | |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 18 | |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 19 | <p>The Android build process provides project and module build settings so that |
| 20 | your Android modules are compiled and packaged into <code>.apk</code> files, the containers |
| 21 | for your application binaries, based on your build settings. The apk file for each app contains all |
| 22 | of 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 |
| 24 | of the <code>AndroidManifest.xml</code> file, compiled resources (<code>resources.arsc</code>) and |
| 25 | uncompiled resource files for your application.</p> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 26 | |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 27 | <p>To run an application on an emulator or device, the application must be signed using debug or |
| 28 | release mode. You typically want to sign your application in debug mode when you develop and test |
| 29 | your application, because the build system uses a debug key with a known password so you do not have |
| 30 | to enter it every time you build. When you are ready to release the application to Google |
| 31 | Play, you must sign the application in release mode, using your own private key.</p> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 32 | |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 33 | <p>If you are using Android development tools, the build system can sign the application for you |
| 34 | when build your app for debugging. You must obtain a certificate to sign your app when you build |
| 35 | and 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 Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 37 | |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 38 | <p>The following diagram depicts the components involved in building and running an application:</p> |
| Scott Main | 50e990c | 2012-06-21 17:14:39 -0700 | [diff] [blame] | 39 | |
| Rich Slogar | 4083327 | 2014-11-06 17:15:28 -0800 | [diff] [blame] | 40 | <img src="{@docRoot}images/build-simplified.png" /> |