30

I have installed an Android app on my phone which I have created myself on java. The App got successfully installed on the device but I am not able to locate the package where it has installed.

How to find the path of the installed application?

il_guru
  • 8,383
  • 2
  • 42
  • 51
user2129794
  • 2,388
  • 8
  • 33
  • 51

6 Answers6

39

You will find the application folder at:

/data/data/"your package name"

you can access this folder using the DDMS for your Emulator. you can't access this location on a real device unless you have a rooted device.

Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • I am able to find the installation file in the Emulator. But cannot find it in the real device as device might not be rooted. This leads me too further followup questions like as below: 1)How to check whether a device is rooted or not 2)Suppose the device is not rooted and I harcode in my code something like `DB_PATH = "/data/data/" + context.getPackageName() + "/databases/` to access the database folder. Would it work on a device where I cannot find /data/data/"package name" – user2129794 Mar 10 '13 at 16:53
  • 2
    for you first question you could use root checker: http://theunlockr.com/2012/06/20/how-to-check-whether-your-android-device-is-rooted-or-not/ http://androidforums.com/rezound-all-things-root/499372-how-know-if-you-rooted.html for you second question: if you device is not rooted then you will not have access to this location in any way as this is the way android is designed to protect the information of installed applications. – Emil Adz Mar 10 '13 at 17:58
  • okk... so if I use something like `DB_PATH = "/data/data/" + context.getPackageName() + "/databases/` then it will work only for the rooted device and not for the unrooted one?? – user2129794 Mar 10 '13 at 18:03
  • Basically what I am trying to do is to store the .db database file in **assets** folder and then after installation I want to copy the .db file from assets to the default database location. Something similar to this page answer [link]stackoverflow.com/questions/9109438/ – user2129794 Mar 10 '13 at 18:04
  • I think that you should create an SQLite DB in your app and at installation of application, or first boot... copy all the content of your DB to the application's one. I don't think that what you are trying to do is possible. but we are going off topic here. I suggest you to accept one of the answers and open a new question with a more specific question of what you are trying to do. this way more people will try to help you. – Emil Adz Mar 10 '13 at 19:04
  • What if there are multiple users? Which path do each of them have the data stored at? – android developer Aug 20 '15 at 21:32
  • I'd like to point out that if you have the ability to use run-as you can use run-as ls or similiar. Take note that Samsung phones, when updated through OTA the access to run-as is ruined. – Crypth Mar 28 '18 at 10:21
13

System apps installed /system/app/ or /system/priv-app. Other apps can be installed in /data/app or /data/preload/.

Connect to your android mobile with USB and run the following commands. You will see all the installed packages.

$ adb shell 

$ pm list packages -f
flame3
  • 2,812
  • 1
  • 24
  • 32
6

An application when installed on a device or on an emulator will install at:

/data/data/APP_PACKAGE_NAME

The APK itself is placed in the /data/app/ folder.

These paths, however, are in the System Partition and to access them, you will need to have root. This is for a device. On the emulator, you can see it in your logcat (DDMS) in the File Explorer tab

By the way, it only shows the package name that is defined in your Manifest.XML under the package="APP_PACKAGE_NAME" attribute. Any other packages you may have created in your project in Eclipse do not show up here.

Siddharth Lele
  • 27,623
  • 15
  • 98
  • 151
  • @Siddharth... I am able to find the installation file in the Emulator. But cannot find it in the real device as device might not be rooted. This leads me too further followup questions like as below: 1)How to check whether a device is rooted or not 2)Suppose the device is not rooted and I harcode in my code something like `DB_PATH = "/data/data/" + context.getPackageName() + "/databases/` to access the database folder. Would it work on a device where I cannot find /data/data/"package name" – user2129794 Mar 10 '13 at 16:55
  • @user2129794: if you intend to store the database at its default location, you don't need to worry about that part. Here is a nice tutorial that explains it: http://www.vogella.com/articles/AndroidSQLite/article.html#overview_sqliteandroid – Siddharth Lele Mar 10 '13 at 17:21
  • @user2129794 The user will not see the /data/data folders without having root. But the OS always knows about it. – Siddharth Lele Mar 10 '13 at 17:22
  • have gone through the tutorial. Basically what I am trying to do is to store the .db database file in **assets** folder and then after installation I want to copy the .db file from assets to the default database location. Something similar to this page answer [link]http://stackoverflow.com/questions/9109438/how-to-use-an-existing-database-with-an-android-application . What I understand from the tutorial and this discussion is that it should not be a problem. Please correct me if I am wrong. – user2129794 Mar 10 '13 at 17:43
3

->List all the packages by :

adb shell su 0 pm list packages -f

->Search for your package name by holding keys "ctrl+alt+f".

->Once found, look for the location associated with it.

kamran khader
  • 329
  • 3
  • 3
2

The package it-self is located under /data/app/com.company.appname-xxx.apk.

/data/app/com.company.appname is only a directory created to store files like native libs, cache, ecc...

You can retrieve the package installation path with the Context.getPackageCodePath() function call.

Sdra
  • 2,297
  • 17
  • 30
1
/data/data/"your app package name " 

but you wont able to read that unless you have a rooted device

DjHacktorReborn
  • 2,908
  • 2
  • 20
  • 29
  • On more modern Android, that folder *can* now be [read via `adb`](https://stackoverflow.com/a/7712173). No rooted device needed anymore. – tanius Jun 26 '20 at 13:56