Android 스튜디오 2.0(2016년 4월)

참고: N 개발자 프리뷰용으로 개발 중이라면 Android 스튜디오 2.1 미리보기를 사용해야 합니다. Android 스튜디오 2.0에서는 N Preview를 타겟팅하는 데 필요한 모든 기능을 지원하지 않습니다.

Instant Run:

  • Android 스튜디오에서는 이제 어느 때보다 빠르게 클린 빌드를 배포합니다. 또한 에뮬레이터나 실제 기기로 증분 코드 변경사항을 푸시하면 거의 즉시 반영됩니다. 새로운 디버그 빌드를 재배포하지 않고 또는 대부분의 상황에서 앱을 다시 시작하지 않고 업데이트를 검토할 수 있습니다.
  • <li>Instant Run supports pushing the following changes to a running app:
      <ul>
        <li>Changes to the implementation of an existing instance method or
        static method
        </li>
        <li>Changes to an existing app resource
        </li>
        <li>Changes to structural code, such as a method signature or a static
        field (requires a target device running API level 21 or higher).
        </li>
      </ul>
    </li>
    
    <li>Read the documentation to learn more <a href=
    "/tools/building/building-studio.html#instant-run">about Instant
    Run</a>.
      <p class="note">
        <strong>Note:</strong> Instant Run is supported only when you deploy the
        debug build variant, use <a href=
        "/tools/revisions/gradle-plugin.html#revisions">Android plugin for
        Gradle version 2.0.0</a> or higher, and configure your app's module-level
        <code>build.gradle</code> file for <code>minSdkVersion 15</code> or higher.
        For the best performance, configure your app for <code>minSdkVersion
        21</code> or higher.
      </p>
    </li>
    

린트의 새로운 추가사항:

  • 모든 상수가 처리되도록 @IntDef 주석이 달린 정수를 사용하는 switch 문을 검사합니다. 누락된 문을 빠르게 추가하려면 인텐트 작업 드롭다운 메뉴를 사용하고 Add Missing @IntDef Constants를 선택합니다.
  • build.gradle 파일에 버전 번호를 삽입하기 위해 문자열 보간 유형을 사용하는 잘못된 시도에 플래그를 지정합니다.
  • Fragment 클래스를 확장하는 익명 클래스에 플래그를 지정합니다.
  • res/asset/ 폴더와 같이 안전하지 않은 위치의 네이티브 코드에 플래그를 지정합니다. 이 플래그는 libs/ 폴더에 네이티브 코드를 보관하도록 유도하며, 이렇게 하면 설치 시 애플리케이션의 data/app-lib/ 폴더로 안전하게 패키징됩니다. AOSP: #169950
  • Runtime.load()System.load()의 안전하지 않은 호출에 플래그를 지정합니다. AOSP: #179980
  • 메뉴 바에서 Refactor > Remove Unused Resources를 선택하여 사용하지 않는 리소스를 찾아 삭제합니다. 사용하지 않는 리소스 감지는 사용되지 않는 리소스에서 참조하는 리소스, .html 이미지 참조와 같은 원시 파일의 참조, Gradle 리소스 축소기에서 사용되는 tools:keeptools:discard 속성만 지원하며 비활성 소스 세트(예: 기타 빌드 버전에서 사용되는 리소스)를 고려하고 정적 필드 가져오기를 올바르게 처리합니다.
  • minSdkVersion에서 타겟팅하는 모든 플랫폼에서 암시적 API 참조가 지원되는지 확인합니다.
  • RecyclerViewParcelable의 부적절한 사용에 플래그를 지정합니다.
  • @IntDef, @IntRange@Size 검사에서는 이제 int 배열 및 varargs도 확인합니다.

추가 개선사항:

  • 어느 때보다 빠르고, 광범위한 가상 기기를 지원하며 UI가 대폭 개선된 Android Emulator 2.0에 최적화되었습니다. 새 에뮬레이터에 관해 자세히 알아보려면 SDK 도구 출시 노트를 참고하세요.
  • <li>Improvements to the <a href=
    "/tools/devices/managing-avds.html">Android Virtual Device
    Manager</a>:
      <ul>
        <li>System images are now categorized under the following tabs:
        <em>Recommended</em>, <em>x86</em>, and <em>Other</em>.
        </li>
        <li>Under advanced settings, you can enable multi-core support and
        specify the number of cores the emulator can use.
        </li>
        <li>Under advanced settings, you can determine how graphics are rendered
        on the emulator by selecting one of the following options:
          <ul>
            <li>
              <strong>Hardware:</strong> use you computer's graphics card for
              faster rendering.
            </li>
            <li>
              <strong>Software:</strong> use software-based rendering.
            </li>
            <li>
              <strong>Auto:</strong> let the emulator decide the best option. This
              is the default setting.
            </li>
          </ul>
        </li>
      </ul>
    </li>
    
    <li>Improved AAPT packaging times by specifying deploy target before the app
    is built. This allows Android Studio to efficiently package only the
    resources required by the specified device.
    </li>
    
    <li>Added Cloud Test Lab integration to provide on-demand app testing with
    the convenience and scalability of a cloud service. Learn more about how you
    can <a href="/training/testing/start/index.html#run-ctl">use Cloud
    Test Lab with Android Studio</a>.
    </li>
    
    <li>Added a preview of the new <a class="external-link" href=
    "//tools.android.com/tech-docs/gpu-profiler">GPU Debugger</a>. For graphics
    intensive applications, you can now visually step through your OpenGL ES code
    to optimize your app or game.
    </li>
    
    <li>Added Google App Indexing Test. Add support for URLs, app
    indexing, and search functionality to your apps to help drive more
    traffic to your app, discover which app content is used most, and attract
    new users. Test and validate URLs in your app all within Android
    Studio. See <a href=
    "/tools/help/app-link-indexing.html">Supporting URLs and App
      Indexing in Android Studio</a>.
    </li>
    
    <li>Upgrades from the latest IntelliJ 15 release, including improved code
    analysis and performance. See <a class="external-link" href=
    "https://www.jetbrains.com/idea/whatsnew">What's New in IntelliJ</a> for a
    complete description of the new features and enhancements.
    </li>
    
    <li>XML editor auto-complete now adds quotations marks when completing
    attributes. To check if this option is enabled, open the <b>Setting</b> or
    <b>Preferences</b> dialogue, navigate to <b>Editor &gt; General &gt; Smart
    Keys</b>, and check the box next to <b>Add quotes for attribute value on
    attribute completion</b>. <a class="external-link" href=
    "//b.android.com/195113">Issue: 195113</a>
    </li>
    
    <li>The XML editor now supports code completion for <a href=
    "/topic/libraries/data-binding/index.html#layout_details">data binding</a>
    expressions.
    </li>