views:

1453

answers:

5

After android installs an application from the Marketplace, does it keep the .apk file?

Is there a standard location where Android would keep such files?

+1  A: 

In /data/app but for copy protection I don't think you can access it.

BrennaSoft
A: 

You can pull apps with ADB. They are in /System/App/, I believe.

adb pull (location on device) (where to save)

Note that you have to root your phone to pull copy protected apps.

Bryan Denny
+1  A: 

It is in /system/app folder. I guess you can't access unless you have a rooted phone. I don't have a non rooted phone here but try this code out:

public class Testing extends Activity {
    private static final String TAG = "TEST";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        File appsDir = new File("/system/app");

        String[] files = appsDir.list();

        for (int i = 0 ; i < files.length ; i++ ) {
            Log.d(TAG, "File: "+files[i]);

        }
    }

It does lists the apks in my rooted htc magic and in the emu.

Macarse
This worked like a Charm on Motorola Droid and also on Nexus One both Non-rooted.
Gubatron
Ok, you never said what you want them for :)
Macarse
I want to be able to read them and do things with them. Luckily they are readable.
Gubatron
Good thing is that not only the files are "listable", they're also readable, so they'll fit my purpose.
Gubatron
It's actually `/data/app`. The `/system` partition is read-only; that's where pre-installed apps live.
Christopher
+4  A: 

There is no standard location, however you can use the PackageManager to find out about packages and the ApplicationInfo class you can get from there has various information about a particular package: the path to its .apk, the path to its data directory, the path to a resource-only .apk (for forward locked apps), etc. Note that you may or may not have permission to read these directories depending on your relationship with the other app; however, all apps are able to read the resource .apk (which is also the real .apk for non-forward-locked app).

If you are just poking around in the shell, currently non-forward-locked apps are located in /data/app/.apk. The shell user can read a specific .apk, though it can't list the directory. In a future release the naming convention will be changed slightly, so don't count on it remaining the same, but if you get the path of the .apk from the package manager then you can use it in the shell.

hackbod
A: 

When i installed my app on emulator, it showed my the .apk file in

data/app Then I used ls data/app //to see if it exists or not

After you install your app just use ls command vie shell and check desired directory but it depends what kind of application you are trying to install. I used this method to Install Point if any thing is wrong.

DeAviator