À partir du 27 mars 2025, nous vous recommandons d'utiliser android-latest-release
au lieu de aosp-main
pour créer et contribuer à AOSP. Pour en savoir plus, consultez la section Modifications apportées à AOSP.
Activer l'option de rétrocompatibilité de 16 ko
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Le boutons d'activation/de désactivation de 16 ko vous permet d'exécuter un appareil avec un kernel de 16 ko. L'option de rétrocompatibilité 16 ko est disponible lorsqu'un appareil exécute un kernel 16 ko. Le gestionnaire de paquets exécute une application en mode rétrocompatibilité de 16 ko si l'application contient des fichiers ELF (avec une extension .so
) avec un alignement de segment LOAD de 4 ko, ou si l'APK compressé contient des fichiers ELF non compressés alignés sur 4 ko. Si le gestionnaire de paquets a activé le mode rétrocompatibilité de 16 ko pour une application, celle-ci affiche un avertissement lors de son premier lancement, indiquant qu'elle s'exécute en mode rétrocompatibilité de 16 ko.
Figure 1 : Avertissement en mode de compatibilité de taille de page.
Le mode rétrocompatibilité de 16 Ko permet à certaines applications de fonctionner, mais pour une fiabilité et une stabilité optimales, les applications doivent toujours être alignées sur 16 Ko.
Pour activer l'option de rétrocompatibilité 16 ko, procédez comme suit :
Suivez la procédure décrite dans Activer le bouton d'activation des 16 ko pour activer le bouton d'activation des 16 ko.
Activez le mode rétrocompatibilité 16 ko à l'aide de l'une des méthodes suivantes :
Android exécute les applications en mode rétrocompatibilité si nécessaire. La rétrocompatibilité se compose de deux parties distinctes qui peuvent être activées indépendamment : la propriété bionic.linker.16kb.app_compat.enabled
contrôle le chargement des bibliothèques, et la propriété pm.16kb.app_compat.disabled
contrôle l'installation des APK.
Pour forcer la rétrocompatibilité de 16 ko pour chaque application de l'appareil :
adb shell setprop bionic.linker.16kb.app_compat.enabled true
adb shell setprop pm.16kb.app_compat.disabled false
Pour désactiver la rétrocompatibilité de 16 ko pour chaque application de l'appareil :
adb shell setprop bionic.linker.16kb.app_compat.enabled false
adb shell setprop pm.16kb.app_compat.disabled true
Définissez la propriété android:pageSizeCompat
sur enabled
ou disabled
pour activer ou désactiver le mode rétrocompatibilité pour une application spécifique dans son AndroidManifest.xml
. Lorsque cette propriété est définie, l'application n'affiche pas d'avertissements de compatibilité ascendante au lancement.
Sur la page d'informations de l'application, sous Avancé, activez ou désactivez le paramètre Exécuter l'application en mode de compatibilité de taille de page pour activer ou désactiver le mode rétrocompatibilité 16 ko pour une application spécifique. Ce paramètre n'est visible que lorsque l'appareil exécute une application avec une taille de page de 16 ko.
Figure 2. Paramètre du mode de compatibilité de taille de page.
Le contenu et les exemples de code de cette page sont soumis aux licences décrites dans la Licence de contenu. Java et OpenJDK sont des marques ou des marques déposées d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/27 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/07/27 (UTC)."],[],[],null,["# Enable 16 KB backcompat option\n\n[16 KB toggle](/docs/core/architecture/16kb-page-size/16kb-developer-option)\nlets you to run a device with a 16 KB kernel. The 16 KB backcompat\noption is available when a device is running with a 16 KB kernel. The\npackage manager runs an app in 16 KB backcompat mode if the app has ELF\nfiles (with an `.so` extension) with a LOAD segment alignment of 4 KB, or\nif the zipped APK has uncompressed ELF files that are 4 KB zip aligned. If\nthe package manager has enabled 16 KB backcompat mode for an app, the app\ndisplays a warning when it's first launched saying that it's running in\n16 KB backcompat mode.\n\n**Figure 1.** Warning in page size compat mode.\n\n16 KB backcompat mode allows some apps to work,\nbut for best reliability and stability, apps should still be 16 KB aligned.\n\nTo enable the 16 KB backcompat option, follow these instructions:\n\n1. Follow the steps in [Enable 16 KB toggle](/docs/core/architecture/16kb-page-size/16kb-developer-option)\n to enable 16 KB toggle.\n\n2. Enable 16 KB backcompat mode using any of the following methods:\n\n - Android runs apps in backcompat mode where it is needed. There are two\n separate parts to backcompat that can be enabled independently: the\n `bionic.linker.16kb.app_compat.enabled` property controls how libraries\n are loaded, and the `pm.16kb.app_compat.disabled` property controls how\n APKs are installed.\n\n - To force 16 KB backcompat on for every app on the device:\n\n adb shell setprop bionic.linker.16kb.app_compat.enabled true\n adb shell setprop pm.16kb.app_compat.disabled false\n\n - To force 16 KB backcompat off for every app on the device:\n\n adb shell setprop bionic.linker.16kb.app_compat.enabled false\n adb shell setprop pm.16kb.app_compat.disabled true\n\n - Set the `android:pageSizeCompat` property to `enabled` or `disabled` to\n turn on or off backcompat mode for a specific app in its\n `AndroidManifest.xml`. When this property is set, the app won't display\n backcompat mode warnings when it launches.\n\n - On the app info page, under **Advanced** toggle the setting **Run app with\n page size compat mode** to enable or disable the 16 KB backcompat mode\n for specific app. This setting is only visible when the device is running with\n 16 KB page size.\n\n **Figure 2.** Page size compat mode setting."]]