앱의 기본 공개 상태가 앱에 미치는 영향을 자세히 알아보려면 패키지 필터링의 로그 메시지를 사용 설정하면 됩니다. Android 스튜디오에서 테스트 앱 또는 디버그 가능한 앱을 개발하고 있다면 시스템 로그에서 이 기능을 자동으로 제공합니다. 그 외에는 터미널 창에서 다음 명령어를 실행하여 수동으로 사용 설정할 수 있습니다.
adb shell pm log-visibility --enable PACKAGE_NAME
그러면 패키지가 PackageManager 객체의 반환 값에서 필터링될 때마다 Logcat에 다음과 유사한 메시지가 표시됩니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["If your app relies on interactions with other apps to complete its use cases,\nit's useful to test how [package visibility](/training/package-visibility)\nchanges in Android 11 (API level 30) and higher affect your app.\n\nThis guide also gives some suggestions on how to test the behavior changes\nand helps you configure log messages to determine at a more granular\nlevel how your app might be affected.\n\nTest the behavior changes\n\nTo test whether this behavior change affects your app, complete the\nfollowing steps:\n\n1. Install [Android Studio 3.6.1](/studio) or higher.\n2. Install the latest version of Gradle that Android Studio supports.\n3. Set your app's `targetSdkVersion` to `30` or higher.\n4. Don't include the `\u003cqueries\u003e` element in your app's manifest file.\n5. Call [`getInstalledApplications()`](/reference/android/content/pm/PackageManager#getInstalledApplications(int)) or [`getInstalledPackages()`](/reference/android/content/pm/PackageManager#getInstalledPackages(int)). Both methods return a filtered list when they are successful.\n6. See which features of your app aren't working.\n7. Introduce appropriate [`\u003cqueries\u003e`](/guide/topics/manifest/queries-element) entries to fix those features.\n\nConfigure log messages for package filtering\n\nTo discover more details about how the default visibility of apps affects your\napp, you can enable log messages for package filtering. If you're developing a\ntest app or debuggable app in Android Studio, the [system log provides this\ncapability](/studio/debug#systemLog) for you. Otherwise, you can run the\nfollowing command in a terminal window to enable it manually: \n\n```\nadb shell pm log-visibility --enable PACKAGE_NAME\n```\n\nThen, whenever packages are filtered out of a `PackageManager` object's return\nvalues, you see a message similar to the following in Logcat: \n\n```\nI/AppsFilter: interaction: PackageSetting{7654321 \\\n com.example.myapp/12345} -\u003e PackageSetting{...} BLOCKED\n```\n| **Caution:** Your app's performance is affected when this flag is enabled. Unless you're testing how package visibility affects your app, disable the logging of messages related to package visibility."]]