플랫폼 코드 디버그
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
플랫폼용 Android 스튜디오 (ASfP)는 다음 작업을 할 수 있는 강력한 디버거를 제공합니다.
- 디버깅할 기기를 선택합니다.
- 자바, Kotlin, C/C++ 코드에 중단점을 설정합니다.
- 런타임에 변수를 검사하고 표현식을 평가합니다.
디버거를 사용하기 전에 빌드를 기기나 에뮬레이터에 플래시해야 합니다.
앱 프로세스 (Java/Kotlin) 디버깅
Java 또는 Kotlin 애플리케이션 프로세스를 디버그하려면 다음 단계를 따르세요.
ASfP 내에서 Java 또는 Kotlin 코드에 중단점을 설정합니다.
메뉴에서 Run > Attach Debugger to Android Process를 선택합니다.
Choose Process 대화상자에서 Debug type이 Java Only로 설정되어 있는지 확인합니다.
목록에서 기기를 선택합니다.
디버그할 특정 애플리케이션 프로세스를 선택합니다.
OK(확인)을 클릭합니다.
기기에서 애플리케이션과 상호작용하여 중단점을 적중합니다.
시스템 프로세스 (C/C++) 디버깅
C 또는 C++로 작성된 시스템 프로세스를 디버그하려면 다음을 실행하세요.
실행 중인 기기 또는 에뮬레이터가 하나만 있는지 확인합니다.
터미널을 열고 AOSP 체크아웃 루트에서 adb root
를 실행합니다. bash
adb root
ASfP 내 C/C++ 코드에 중단점을 설정합니다.
메뉴에서 Run > Attach Debugger to Android Process를 선택합니다.
Choose Process 대화상자에서 Debug type을 Native Only 또는 Dual (Java + Native)로 변경합니다.
Show all processes 체크박스를 선택하여 시스템 프로세스를 확인합니다.
목록에서 기기를 선택합니다.
디버그할 특정 시스템 프로세스 (예: surfaceflinger
또는 system_server
)를 선택합니다.
OK(확인)을 클릭합니다.
디버거가 프로세스에 연결됩니다. 기기와 상호작용하여 중단점을 적중합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-09-04(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["Android Studio for Platform (ASfP) provides a powerful debugger that lets you:\n\n- Select a device to debug on.\n- Set breakpoints in your Java, Kotlin, and C/C++ code.\n- Examine variables and evaluate expressions at runtime.\n\nBefore you use the debugger, you must flash your build to a device or emulator.\n\nApp process (Java/Kotlin) debugging\n\nTo debug a Java or Kotlin application process:\n\n1. Set breakpoints in your Java or Kotlin code within ASfP.\n\n2. Select **Run \\\u003e Attach Debugger to Android Process** from the menu.\n\n3. In the **Choose Process** dialog, make sure the **Debug type** is set to\n **Java Only**.\n\n4. Select your device from the list.\n\n5. Choose the specific application process you want to debug.\n\n6. Click **OK**.\n\n7. Interact with the application on your device to hit the breakpoints.\n\nSystem process (C/C++) debugging\n\nTo debug a system process written in C or C++:\n\n1. Verify that you have only one device or emulator running.\n\n2. Open a terminal and run `adb root` from your AOSP checkout root: `bash\n adb root`\n\n\u003c!-- --\u003e\n\n1. Set breakpoints in your C/C++ code within ASfP.\n\n2. Select **Run \\\u003e Attach Debugger to Android Process** from the menu.\n\n3. In the **Choose Process** dialog, change the **Debug type** to **Native\n Only** or **Dual (Java + Native)**.\n\n4. Check the **Show all processes** box to see system processes.\n\n5. Select your device from the list.\n\n6. Choose the specific system process you want to debug (such as\n `surfaceflinger` or `system_server`).\n\n7. Click **OK**.\n\n8. The debugger attaches to the process. Interact with the device to hit your\n breakpoints."]]