Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ffb90fde authored by David Friedman's avatar David Friedman Committed by Android (Google) Code Review
Browse files

Merge "Docs: Removing most of the Eclipse ADT documentation from DAC." into mnc-docs

parents 4360a3c3 49741566
Loading
Loading
Loading
Loading
+0 −160
Original line number Diff line number Diff line
page.title=Installing the Eclipse Plugin
adt.zip.version=23.0.6
adt.zip.download=ADT-23.0.6.zip
adt.zip.bytes=103344298
adt.zip.checksum=f64b7e50c84799f41c642218c35f1bbe

@jd:body


<p class="caution">
  <strong>Important:</strong> Support for the Android Developer Tools (ADT) in Eclipse is ending,
  per our <a href=
  "http://android-developers.blogspot.com/2015/06/an-update-on-eclipse-android-developer.html"
  class="external-link">announcement</a>. You should migrate your app development projects to
  Android Studio as soon as possible. For more information on transitioning to Android Studio, see
  <a href="{@docRoot}sdk/installing/migrate.html">Migrating to Android Studio</a>.
</p>

<p>Android offers a custom plugin for the Eclipse IDE, called Android
Development Tools (ADT). This plugin provides a powerful, integrated
environment in which to develop Android apps. It extends the capabilities
of Eclipse to let you quickly set up new Android projects, build an app
UI, debug your app, and export signed (or unsigned) app packages (APKs) for distribution.
</p>

<p>You should install the ADT plugin
only if you already have an Eclipse installation that you want to continue using.
Your existing Eclipse installation must meet these requirements:</p>
    <ul>
      <li><a href="http://eclipse.org/mobile/">Eclipse</a> 3.7.2 (Indigo) or greater
<p class="note"><strong>Note:</strong> Eclipse 3.6 (Helios) is no longer
supported with the latest version of ADT.</p></li>
      <li>Eclipse <a href="http://www.eclipse.org/jdt">JDT</a> plugin (included
in most Eclipse IDE packages) </li>
      <li><a href="http://www.oracle.com/technetwork/java/javase/downloads/index.html">JDK 6</a>
        (JRE alone is not sufficient)</li>
      <li><strong>Not</strong> compatible with GNU Compiler for Java (gcj)</li>
    </ul>


<h2 id="Download">Download the ADT Plugin</h2>

<p>To add the ADT plugin to Eclipse:</p>
<ol>
    <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Install New
Software</strong>.</li>
    <li>Click <strong>Add</strong>, in the top-right corner.</li>
    <li>In the Add Repository dialog that appears, enter "ADT Plugin" for the <em>Name</em> and the
following URL for the <em>Location</em>:
      <pre>https://dl-ssl.google.com/android/eclipse/</pre>
      <p class="note"><strong>Note:</strong> The Android Developer Tools update site requires
      a secure connection. Make sure the update site URL you enter starts with HTTPS.</p>
    </li>
    <li>Click <strong>OK</strong>.</li>
    <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
<strong>Next</strong>.</li>
    <li>In the next window, you'll see a list of the tools to be downloaded. Click
<strong>Next</strong>. </li>
    <li>Read and accept the license agreements, then click <strong>Finish</strong>.
      <p>If you get a security warning saying that the authenticity or validity of
the software can't be established, click <strong>OK</strong>.</p></li>
    <li>When the installation completes, restart Eclipse. </li>
</ol>



<h2 id="Configure">Configure the ADT Plugin</h2>

<p>Once Eclipse restarts, you
  must specify the location of your Android SDK directory:</p>

<ol>
    <li>In the "Welcome to Android Development" window that appears, select <strong>Use
existing SDKs</strong>.</li>
    <li>Browse and select the location of the Android SDK directory you recently
downloaded and unpacked.</li>
    <li>Click <strong>Next</strong>.</li>
</ol>

<p>Your Eclipse IDE is now set up to develop Android apps, but you need to add
the latest SDK platform tools and an Android platform to your environment.
To get these packages for your SDK, continue to
<a href="{@docRoot}sdk/installing/adding-packages.html">Adding Platforms and Packages</a>.</p>


<h2 id="Troubleshooting">Troubleshooting ADT Installation</h2>

<p>If you are having trouble downloading the ADT plugin after following the
steps above and you are behind a firewall (such as a corporate firewall), make sure that
you have properly configured your proxy settings in Eclipse. In Eclipse,
you can configure proxy information from the main Eclipse menu in
<strong>Window</strong> (on Mac OS X, <strong>Eclipse</strong>) &gt;
<strong>Preferences</strong> &gt; <strong>General</strong> &gt; <strong>Network
Connections</strong>.
</p>

<p>If you are still unable to use Eclipse to download the ADT plugin as a
remote update site, you can download the ADT zip file to your local machine and
manually install it:</p>

<ol>
  <li>Download the ADT Plugin zip file (do not unpack it):

  <table class="download">
    <tr>
      <th>Package</th>
      <th>Size</th>
      <th>MD5 Checksum</th>
  </tr>
  <tr>
    <td>
      <a href="https://dl.google.com/android/{@adtZipDownload}">{@adtZipDownload}</a>
    </td>
    <td>{@adtZipBytes} bytes</td>
    <td>{@adtZipChecksum}</td>
  </tr>
</table>
</li>

</li>
  <li>Start Eclipse, then select <strong>Help</strong> &gt; <strong>Install New
Software</strong>.</li>
  <li>Click <strong>Add</strong>, in the top-right corner.</li>
  <li>In the Add Repository dialog, click <strong>Archive</strong>.</li>
  <li>Select the downloaded {@adtZipDownload} file and click <strong>OK</strong>.</li>
  <li>Enter "ADT Plugin" for the name and click <strong>OK</strong>.
  <li>In the Available Software dialog, select the checkbox next to Developer Tools and click
<strong>Next</strong>.</li>
  <li>In the next window, you'll see a list of the tools to be downloaded. Click
<strong>Next</strong>. </li>
  <li>Read and accept the license agreements, then click <strong>Finish</strong>.
    <p>If you get a security warning saying that the authenticity or validity of
the software can't be established, click <strong>OK</strong>.</p></li>
  <li>When the installation completes, restart Eclipse. </li>
</ol>

<p>To update your plugin once you've installed using the zip file, you will have
to follow these steps again instead of the default update instructions.</p>

<h4>Other install errors</h4>

<p>Note that there are features of ADT that require some optional
Eclipse packages (for example, WST). If you encounter an error when
installing ADT, your Eclipse installation might not include these packages.
For information about how to quickly add the necessary packages to your
Eclipse installation, see the troubleshooting topic
<a href="{@docRoot}resources/faq/troubleshooting.html#installeclipsecomponents">ADT
Installation Error: "requires plug-in org.eclipse.wst.sse.ui"</a>.</p>

<h4>For Linux users</h4>
<p>If you encounter this error when installing the ADT Plugin for Eclipse:
<pre>
An error occurred during provisioning.
Cannot connect to keystore.
JKS</pre>
<p>
...then your development machine lacks a suitable Java VM. Installing Sun
Java 6 will resolve this issue and you can then reinstall the ADT
Plugin.</p>
+1 −1
Original line number Diff line number Diff line
page.title=Migrating to Android Studio
page.title=Migrating from Eclipse ADT

@jd:body

+0 −389

File deleted.

Preview size limit exceeded, changes collapsed.

+0 −176
Original line number Diff line number Diff line
page.title=Building and Running from Eclipse with ADT
parent.title=Building and Running
parent.link=index.html
@jd:body

<div id="qv-wrapper">
    <div id="qv">
      <h2>In this document</h2>

      <ol>
        <li><a href="#RunningOnEmulatorEclipse">Running on an Emulator</a></li>

        <li><a href="#RunningOnDeviceEclipse">Running on a Device</a></li>

        <li><a href="#RunConfig">Creating a Run Configuration</a></li>
      </ol>
    </div>
  </div>

  <p>Eclipse and ADT provide an environment where most of the details of the build process are
  hidden from you. By default, the build process constantly runs in the background as you make
  changes to your project.</p>

  <p>When Eclipse automatically builds your application, it enables debugging and signs the
  <code>.apk</code> with a debug key, by default. When you run the application,
  Eclipse invokes ADB and installs your application to a device or emulator, so you do not have to
  manually perform these tasks. Since most of the build process is taken care of by Eclipse, the
  following topics show you how to run an application, which will automatically build your
  application as well.</p>

  <p>To distribute your application, however, you must build your application in release mode and
  sign the <code>.apk</code> file with your own private key.</p>

   <p>This document shows you how to run your application on an emulator or a real device
   from Eclipse&mdash;all of which is done using the debug version of your application.
   For more information about how to sign your application with a private key for release, see <a href=
  "{@docRoot}tools/publishing/app-signing.html#ExportWizard">Signing Your Applications</a></p>

  <h2 id="RunningOnEmulatorEclipse">Running on the emulator</h2>

  <p>Before you can run your application on the Android Emulator, you must <a href=
  "{@docRoot}tools/devices/managing-avds.html">create an AVD</a>.</p>

  <p>To run (or debug) your application, select <strong>Run</strong> &gt; <strong>Run</strong> (or
  <strong>Run</strong> &gt; <strong>Debug</strong>) from the Eclipse menu bar. The ADT plugin will
  automatically create a default run configuration for the project. Eclipse will then perform the
  following:</p>

  <ol>
    <li>Compile the project (if there have been changes since the last build).</li>

    <li>Create a default run configuration (if one does not already exist for the project).</li>

    <li>Install and start the application on an emulator (or device), based on the Deployment
    Target defined by the run configuration.

      <p>By default, Android run configurations use an "automatic target" mode for selecting a
      device target. For information on how automatic target mode selects a deployment target, see
      <a href="#AutoAndManualTargetModes">Automatic and manual target modes</a> below.</p>
    </li>
  </ol>

  <p>If you run the application with the Debug option, the application will start in the "Waiting For Debugger" mode. Once the debugger
  is attached, Eclipse opens the Debug perspective and starts the application's main activity. Otherwise, if you run the
  application with the normal Run option, Eclipse installs the application on the device and launches the main activity.</p>

  <p>To set or change the run configuration used for your project, use the run configuration
  manager. See the section below about <a href="#RunConfig">Creating a Run Configuration</a> for more information.</p>

  <p>Be certain to create multiple AVDs upon which to test your application. You should have one
  AVD for each platform and screen type with which your application is compatible. For instance, if
  your application compiles against the Android 4.0 (API Level 14) platform, you should create an
  AVD for each platform equal to and greater than 4.0 and an AVD for each <a href=
  "{@docRoot}guide/practices/screens_support.html">screen type</a> you support, then test your
  application on each one.</p>

  <h2 id="RunningOnDeviceEclipse">Running on a device</h2>

  <p>Before you can run your application on a device, you must perform some basic setup for your
  device:</p>

  <ul>
    <li>Ensure that your application is debuggable by setting the
    <code>android:debuggable</code> attribute of the <code>&lt;application&gt;</code>
    element to <code>true</code>. As of ADT 8.0, this is done by default when you build in debug mode.</li>

    <li>Enable <strong>USB debugging</strong> on your device.
      <ul>
        <li>On most devices running Android 3.2 or older, you can find the option under
          <strong>Settings > Applications > Development</strong>.</li>
        <li>On Android 4.0 and newer, it's in <strong>Settings > Developer options</strong>.
          <p class="note"><strong>Note:</strong> On Android 4.2 and newer, <strong>Developer
          options</strong> is hidden by default. To make it available, go
          to <strong>Settings > About phone</strong> and tap <strong>Build number</strong>
          seven times. Return to the previous screen to find <strong>Developer options</strong>.</p>
        </li>
      </ul>
    </li>

    <li>Ensure that your development computer can detect your device when connected via USB</li>
  </ul>

  <p>Read <a href="{@docRoot}tools/device.html">Using Hardware Devices</a>
  for more information.</p>

  <p>Once set up and your device is connected via USB, install your application on the device by
  selecting <strong>Run</strong> &gt; <strong>Run</strong> (or <strong>Run</strong> &gt;
  <strong>Debug</strong>) from the Eclipse menu bar.</p>

  <h2 id="RunConfig">Creating a Run Configuration</h2>

  <p>The run configuration specifies the project to run, the Activity to start, the emulator or
  connected device to use, and so on. When you first run a project as an <em>Android
  Application</em>, ADT will automatically create a run configuration. The default run
  configuration will launch the default project Activity and use automatic target mode for device
  selection (with no preferred AVD). If the default settings don't suit your project, you can
  customize the run configuration or even create a new one.</p>

  <p>To create or modify a run configuration, refer to the Eclipse documentation on how to create Run configurations.
  The following steps highlight the important things you need to do for an Android project:</p>

  <ol>
    <li>Open the run configuration manager from the Run Menu.</li>

    <li>Expand the <strong>Android Application</strong> item and create a new configuration or open
    an existing one.
    </li>

    <li>With the Run Configuration selected, adjust your desired run configuration settings:
      <ul>
      <li>In the Android tab, specify the Project and Activity to launch.
      </li>
      <li><p>In the Target tab, consider whether you'd like to use Manual or Automatic mode when
      selecting an AVD to run your application. See the following section on <a href=
      "#AutoAndManualTargetModes">Automatic and manual target modes</a>).</p>

      <p>You can specify any emulator options to the Additional Emulator Command Line Options
      field. For example, you could add <code>-scale 96dpi</code> to scale the AVD's screen to an
      accurate size, based on the dpi of your computer monitor. For a full list of emulator
      options, see the <a href="{@docRoot}tools/help/emulator.html">Android
      Emulator</a> document.</p>
      </li>
      </ul>
    </li>
  </ol>

  <h4 id="AutoAndManualTargetModes">Automatic and manual target modes</h4>

  <p>By default, a run configuration uses the <strong>automatic</strong> target mode in order to
  select an AVD. In this mode, ADT will select an AVD for the application in the following
  manner:</p>

  <ol>
    <li>If there's a device or emulator already running and its AVD configuration meets the
    requirements of the application's build target, the application is installed and run upon
    it.</li>

    <li>If there's more than one device or emulator running, each of which meets the requirements
    of the build target, a "device chooser" is shown to let you select which device to use.</li>

    <li>If there are no devices or emulators running that meet the requirements of the build
    target, ADT looks at the available AVDs. If there is an AVD that matches the build target of the
    project, ADT chooses that AVD. If the AVD versions are newer than the build target of the project,
    ADT chooses the oldest possible version of an AVD that meets the project's build target
    requirement.</li>

    <li>If there are no suitable AVDs, the application is not installed a console error warning tells
    you that there is no existing AVD that meets the build target requirements.</li>
  </ol>

  <p>However, if a "preferred AVD" is selected in the run configuration, then the application will
  <em>always</em> be deployed to that AVD. If it's not already running, then a new emulator will be
  launched.</p>

  <p>If your run configuration uses <strong>manual</strong> mode, then the "device chooser" is
  presented every time that your application is run, so that you can select which AVD to use.</p>
+0 −67
Original line number Diff line number Diff line
page.title=Debugging from Eclipse with ADT
parent.title=Debugging
parent.link=index.html
@jd:body

 <div id="qv-wrapper">
    <div id="qv">
      <h2>In this document</h2>

      <ol>
        <li><a href="#tools">The Debug Perspective</a></li>

        <li><a href="#toptips">The DDMS Perspective</a></li>
      </ol>
    </div>
  </div>
  
  <p>If you are developing in Eclipse with the ADT plugin, you can use the built-in Java Debugger,
  along with DDMS, to debug your applications. To access the debugger and
  DDMS, Eclipse displays the debugger and DDMS features as perspectives, which are customized
  Eclipse views that display certain tabs and windows depending on the perspective that you are in.
  Eclipse also takes care of starting the ADB host daemon for you, so you do not have to run this
  manually.</p>

  <h2>The Debug Perspective in Eclipse</h2>

  <p>The Debug Perspective in Eclipse gives you access to the following tabs:</p>

  <ul>
    <li>Debug - Displays previously and currently debugged Android applications and its currently
    running threads</li>

    <li>Variables - When breakpoints are set, displays variable values during code execution</li>

    <li>Breakpoints - Displays a list of the set breakpoints in your application code</li>

    <li>LogCat - Allows you to view system log messages in real time. The LogCat tab is also
    available in the DDMS perspective.</li>
  </ul>
  <p>You can access the Debug Perspective by clicking <strong>Window &gt; Open Perspective &gt;
  Debug</strong>. Refer to the appropriate documentation for the Eclipse debugger for more
  information.</p>

  <h2>The DDMS Perspective</h2>
  <p>The DDMS Perspective in Eclipse lets you access all of the features
  of DDMS from within the Eclipse IDE. The following sections of DDMS are available to you:</p>

  <ul>
    <li>Devices - Shows the list of devices and AVDs that are connected to ADB.</li>

    <li>Emulator Control - Lets you carry out device functions.</li>

    <li>LogCat - Lets you view system log messages in real time.</li>

    <li>Threads - Shows currently running threads within a VM.</li>

    <li>Heap - Shows heap usage for a VM.</li>

    <li>Allocation Tracker - Shows the memory allocation of objects.</li>

    <li>File Explorer - Lets you explore the device's file system.</li>
  </ul>
  <p>To access the DDMS perspective, go to <strong>Window &gt; Open Perspective &gt;
  DDMS</strong>. If DDMS does not appear, go to <strong>Window &gt; Open Perspective &gt; Other
  ...</strong> and select <strong>DDMS</strong> from the Open Perspective window that appears. For
  more information on using DDMS, see <a href="ddms.html">Using the Dalvik Debug Monitor Server</a>.
  </p>
 No newline at end of file
Loading