...
Wiki Markup |
---|
{redirect:https://www.jetbrains.com/idea/help/running-and-debugging-android-applications.html |
...
...
HTML |
---|
<table width="100%" class="navigation">
<tr>
<td width="33%" align="left"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Explore+the+Project+Structure">Previous</a></td|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3EPrevious%3C/a%3E%3C/td]>
<td width="33%" align="center"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA">Top</a></td|http://confluence.jetbrains.com/display/IntelliJIDEA/Getting+Started+with+Android+Development+in+IntelliJ+IDEA%22%3ETop%3C/a%3E%3C/td]>
<td width="33%" align="right"><a href="http://confluence.jetbrains.com/display/IntelliJIDEA/Edit+the+UI+Layout+Using+the+Designer">Next</a></td>
</tr>
</table>
|
...
1. Edit Run/Debug configurations
From the
span |
---|
|
Run → Edit configurations Wiki Markup |
---|
{span:class=shortcut}Run → Edit configurations{span} |
menu, you get the dialog box below.
...
A new item will be added to the tree view with the default name
span |
---|
|
Unnamed Wiki Markup |
---|
{span:class=id}Unnamed{span} |
. Select it and enter a more significant name in the
Name input field: for example,
span |
---|
|
HelloDroid Emulator Wiki Markup |
---|
{span:class=id}HelloDroid Emulator{span} |
.

The newly created configuration is rendered with a red cross to indicate it is not ready yet to be used. The reason is that it lacks essential information.
...
Expand the Module drop-down and select
span |
---|
|
HelloDroid Emulator Wiki Markup |
---|
{span:class=id}HelloDroid Emulator{span} |
: the only executable module in the project. As you select the module, the red cross disappears meaning that the configuration is now complete.
...
Any Android executable module needs a starter activity. Your choice is to use the activity configured as the launch activity in the manifest file or a specific activity. In this case, both default activity or
span |
---|
|
Wiki Markup |
---|
{span:class=id}com.example.HelloDroid.MyActivity{span} |
produce the same result as the sample application has only one activity.
...
To build the project, you just press
span |
---|
|
Shift + F10 Wiki Markup |
---|
{span:class=shortcut}Shift + F10{span} |
or click
span |
---|
|
Run Wiki Markup |
---|
{span:class=shortcut}Run{span} |
. In both cases, the project will be built according to the currently selected configuration: the same you see in the drop-down list.
...
By clicking on the drop-down list, or pressing
span |
Alt + Shift + F10 Wiki Markup |
---|
{span}Alt + Shift + F10{span} |
you bring up a chooser dialog box that allows you to pick up the build configuration of choice.
...
Finally, IntelliJ IDEA allows you to set breakpoints in the source code to debug the application. To start a debug session, you explicitly click on
span |
---|
|
Run → Wiki Markup |
---|
{span:class=shortcut}Run → Debug...{span} |
menu items (as opposed to
span |
---|
|
Run → Wiki Markup |
---|
{span:class=shortcut}Run → Run...{span} |
menu item). The IDE does the usual build work and stops execution at the first breakpoint for you to step over.
...