How to get library installation path


Question

Some Android apps require libraries to be linked against by specifying <uses-library> in their Manifest (in the application element):


<uses-library android:name="com.example.customlib" android:required="true" />

It is possible to list the installed libraries on the device by running the following command:


$ adb shell cmd package list libraries

  1 ⨯
library:android.ext.services
library:android.ext.shared
library:android.hidl.base-V1.0-java
library:android.hidl.manager-V1.0-java
library:com.android.future.usb.accessory
library:com.android.location.provider
library:com.android.media.remotedisplay
library:com.google.android.gms
library:com.google.android.trichromelibrary
library:javax.obex
library:org.apache.http.legacy
library:com.example.customlib
...

Where are these libraries installed? Is there a command similar to adb shell pm path com.exaple.packagename that would return the path of com.example.customlib? When I tried pm path, it does not return anything.


Answer

Most of the libraries you search can be found in /system/framework


Example output form an Android 10 device:



 3621 2009-01-01 01:00 CustomPropInterface.jar
193854 2009-01-01 01:00 OPCommonTelephony.jar
21325 2009-01-01 01:00 am.jar
13122 2009-01-01 01:00 android.hidl.base-V1.0-java.jar
31354 2009-01-01 01:00 android.hidl.manager-V1.0-java.jar
33410 2009-01-01 01:00 android.test.base.jar
57302 2009-01-01 01:00 android.test.mock.jar
106118 2009-01-01 01:00 android.test.runner.jar
5693 2009-01-01 01:00 appwidget.jar
31002 2009-01-01 01:00 bmgr.jar
7445 2009-01-01 01:00 bu.jar
5310 2009-01-01 01:00 com.android.future.usb.accessory.jar
20050 2009-01-01 01:00 com.android.location.provider.jar
9230 2009-01-01 01:00 com.android.media.remotedisplay.jar
2906 2009-01-01 01:00 com.android.mediadrm.signer.jar
7954 2009-01-01 01:00 com.android.nfc_extras.jar
19389 2009-01-01 01:00 content.jar
9193 2009-01-01 01:00 dpm.jar
99829 2009-01-01 01:00 duraspeed.jar
38582 2009-01-01 01:00 ethernet-service.jar
3007999 2009-01-01 01:00 ext.jar
27047266 2009-01-01 01:00 framework.jar
17217 2009-01-01 01:00 hid.jar
153906 2009-01-01 01:00 ims-common.jar
13573 2009-01-01 01:00 input.jar
54682 2009-01-01 01:00 javax.obex.jar
3721 2009-01-01 01:00 locksettings.jar
79905 2009-01-01 01:00 log-handler.jar
16086 2009-01-01 01:00 media.jar
114510 2009-01-01 01:00 mediatek-common.jar
99278 2009-01-01 01:00 mediatek-cta.jar
189961 2009-01-01 01:00 mediatek-framework-net.jar
405350 2009-01-01 01:00 mediatek-framework.jar
107978 2009-01-01 01:00 mediatek-ims-base.jar
73974 2009-01-01 01:00 mediatek-ims-common.jar
12061 2009-01-01 01:00 mediatek-ims-extension-plugin.jar
2506910 2009-01-01 01:00 mediatek-ims-legacy.jar
483881 2009-01-01 01:00 mediatek-ims-wwop-common.jar
230333 2009-01-01 01:00 mediatek-services.jar
49334 2009-01-01 01:00 mediatek-telecom-common.jar
361002 2009-01-01 01:00 mediatek-telephony-base.jar
2762490 2009-01-01 01:00 mediatek-telephony-common.jar
1580981 2009-01-01 01:00 mediatek-wfo-legacy.jar
114753 2009-01-01 01:00 monkey.jar
3937 2009-01-01 01:00 mtk-wifi-service.jar
491074 2009-01-01 01:00 org.apache.http.legacy.jar
12445 2009-01-01 01:00 requestsync.jar
10205 2009-01-01 01:00 sm.jar
13273 2009-01-01 01:00 svc.jar
13145 2009-01-01 01:00 telecom.jar
2865674 2009-01-01 01:00 telephony-common.jar
363793 2009-01-01 01:00 uiautomator.jar
99817 2009-01-01 01:00 via-plugin.jar
157682 2009-01-01 01:00 voip-common.jar
4437 2009-01-01 01:00 vr.jar
3391985 2009-01-01 01:00 wifi-service.jar

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes