시계 화면 디버그
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
이 페이지에서는 워치 페이스 형식으로 빌드된 시계 화면을 디버그하는 방법을 설명합니다.
시계 화면 XML을 검사하고 런타임 오류를 식별하는 방법도 설명합니다.
유효한 워치 페이스 형식 문서 확인
워치 페이스 형식에는 게시된 XSD를 준수하는 잘 구성된 XML이 필요하므로 시계 화면의 유효성을 확인하고 오류를 식별할 수 있습니다.
XML 유효성 검사 도구를 사용하여 빌드 프로세스 중에 문제를 식별합니다. 이 도구는 샘플 시계 화면의 빌드 프로세스에 통합되어 있습니다.
시계 화면을 만드는 도구를 빌드하는 경우 도구에서 XSD를 사용하여 XML 유효성 검사를 실행해야 합니다.
유효성 검사 도구를 수동으로 실행하는 예는 다음과 같습니다.
java -jar wff-validator.jar 2 ~/MyWatchface/res/raw/watchface.xml
watchface.xml
문서에 오류가 있으면 height
가 hight
로 잘못 입력된 이 경우와 같이 오류가 표시됩니다.
INFO: DWF Validation Application Version 1.0. Maximum Supported Format Version #2
SEVERE: [Line 41:Column 53]: cvc-complex-type.3.2.2: Attribute 'hight' is not allowed to appear in element 'PartDraw'.
INFO: ❌ FAILED : watchface.xml is NOT valid against watch face format version #1
유효성 검사기는 수정해야 하는 요소의 위치(41번 줄, 53번 열)를 식별합니다.
XML 검사기 도구를 가져오고 사용하기 위해 빌드하는 방법을 알아보세요.
런타임 오류 식별
XML 자체가 유효하다고 해서 모든 잠재적 문제를 포착하기에 충분하지는 않습니다.
예를 들어 XML이 존재하지 않는 글꼴 또는 드로어블 리소스를 참조하거나 표현식에서 숫자 값을 생성해야 하지만 문자열이 생성될 수 있습니다.
이러한 유형의 문제의 경우 Android 스튜디오에서 또는 ADB를 통해 logcat을 사용하면 더 자세한 정보를 얻을 수 있습니다.
'런타임'을 기준으로 필터링하면 시계 화면에 영향을 미치는 심각한 문제와 심각하지 않은 문제가 모두 표시됩니다. 예를 들어 다음과 같이 존재하지 않는 HourHand
의 리소스를 지정하는 경우
E Invalid resource ID 0x00000000.
E FATAL EXCEPTION: main
Process: com.google.wear.watchface.runtime, PID: 29115 android.content.res.Resources$NotFoundException: Resource ID #0x0
잘못된 색상 테마를 사용하려고 할 때도 다음과 같은 오류가 발생합니다.
W color has wrong type of source:CONFIGURATION.myTheeeme.2[OBJECT:]
E Cannot parse theme color. Using theme color WHITE
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(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-07-27(UTC)"],[],[],null,["# Debug a watch face\n\nThis page describes how to debug a watch face built with the Watch Face Format.\nIt also explains how to validate your watch face XML and identify runtime\nerrors.\n\nCheck for valid Watch Face Format documents\n-------------------------------------------\n\nAs the Watch Face Format requires well-structured XML that conforms to a\npublished XSD, you can confirm whether your watch face is valid or not,\nand identify errors.\n\nUse the [XML validation tool](https://github.com/google/watchface/tree/main/third_party/wff) to identify issues during the build\nprocess. This tool is integrated into the build process in the [sample watch\nfaces](https://github.com/android/wear-os-samples/tree/main/WatchFaceFormat).\n\nIf you are building a tool for creating watch faces, be sure that the tool\nperforms XML validation [using the XSD](https://github.com/google/watchface/tree/main/third_party/wff/specification/documents) in your tool.\n\nAn example of running the validation tool manually: \n\n java -jar wff-validator.jar 2 ~/MyWatchface/res/raw/watchface.xml\n\nIf there is an error in your `watchface.xml` document, you'll see an error, such\nas in this case where `height` has been misspelled as `hight`: \n\n INFO: DWF Validation Application Version 1.0. Maximum Supported Format Version #2\n SEVERE: [Line 41:Column 53]: cvc-complex-type.3.2.2: Attribute 'hight' is not allowed to appear in element 'PartDraw'.\n INFO: ❌ FAILED : watchface.xml is NOT valid against watch face format version #1\n\nThe validator identifies the location---line 41, column 53---of the element that\nneeds to be corrected.\n\nLearn how to [obtain the XML validator tool](https://github.com/google/watchface/blob/main/third_party/wff/README.md) and build it for\nuse.\n\n### Identify runtime errors\n\nEnsuring the XML itself is valid is not enough to capture all potential issues.\n\nFor example, your XML might reference a font or drawable resource that does not\nexist, or an expression might be expected to produce a numeric value, but\ninstead results in a string.\n\nFor these types of issues, using logcat, either in Android Studio or through ADB\nis a good way to get more detailed information.\n\nFilter on \"runtime\" and you'll be able to see both fatal and nonfatal issues\naffecting the watch face. For example, here, when specifying a resource for\n`HourHand` which does not exist: \n\n E Invalid resource ID 0x00000000.\n E FATAL EXCEPTION: main\n Process: com.google.wear.watchface.runtime, PID: 29115 android.content.res.Resources$NotFoundException: Resource ID #0x0\n\nOr here, when trying to use a color theme with a typo in it: \n\n W color has wrong type of source:CONFIGURATION.myTheeeme.2[OBJECT:]\n E Cannot parse theme color. Using theme color WHITE"]]