android studio 설정

android sdk 경로를 기본이 아닌 곳에 넣으려면 https://stackoverflow.com/a/37946348/1025379 를 보고 .zshrc에 넣어야 한다.

# .zshrc or .bash_profile
export ANDROID_HOME=~/projects/android/sdk
export PATH=${PATH}:${ANDROID_HOME}/platform-tools
export PATH=${PATH}:${ANDORID_HOME}/tools
export JAVA_HOME=/Applications/"Android Studio.app"/Contents/jre/Contents/Home
export PATH=${PATH}:${JAVA_HOME}

공통 적용

  • Appearance & Behavior
    • Appearance
      • Theme: Dracula
  • Font: JetBrains Mono, 14
    • Enable ligatures: on
  • Editor
    • General
      • Code Completion
        • Match case: off
    • Code Editing
      • Show quick documentation on mouse move: on
    • Color Scheme
      • Android Logcat: http://stackoverflow.com/a/19951203/1025379
    • Live Templete -> Android Log 에서 Log 관련 템플릿 설정하기
    • Design Tools
      • Other Resources: split
  • Keymap
    • Optimize imports: option + command + O
    • code – Completion – Basic: shift + space
    • delete line: command + D
    • Duplicate Entire Lines: option + command + down arrow
    • run: command + r
    • rebuild project: command + b
    • move caret to text start: command + up arrow
    • move caret to text start with selection: shift + command + up arrow
    • move caret to text end: comment + down arrow
    • move caret to text end with selection: shift + command + down arrow

프로젝트별 설정

  • Editor
    • General
      • Auto Import
        • Insert imports on paste: Always
        • (Java/Kotlin) optimize imports on the fly: on
        • Add unambiguous imports on the fly: on
    • Code Style
      • Hard wrap at: 200
      • Java
        • Tab size: 2
        • Indent: 2
        • continuation indent: 2
      • Kotlin
        • Tab size: 2
        • Indent: 2
        • continuation indent: 2 
      • XML
        • Tab size: 2
        • Indent: 2
        • continuation indent: 2

heap 메모리 설정: https://thdev.tech/devtools/2016/08/19/AndroidStudio-heap-Memory-Upgrade/

프로젝트 목록 화면의 왼쪽 하단의 아이콘을 누르면 나오는 Edit Custom VM Options에서 이렇게 수정한다. 나는 램이 32GB라서 저 링크의 수치보다 조금 더 높혔다.

-Xms4096m
-Xmx8192m
-XX:MaxPermSize=2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops