Android 是否保留 .apk 文件?如果是这样在哪里? [英] Does Android keep the .apk files? if so where?

查看:42
本文介绍了Android 是否保留 .apk 文件?如果是这样在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

android 从 Marketplace 安装应用程序后,它会保留 .apk 文件吗?

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

Android 是否有标准位置来保存此类文件?

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

推荐答案

预安装的应用程序位于 /system/app 文件夹中.用户安装的应用程序位于 /data/app 中.我想除非你有一个root手机,否则你无法访问.我这里没有根电话,但试试这个代码:

Preinstalled applications are in /system/app folder. User installed applications are in /data/app. I guess you can't access unless you have a rooted phone. I don't have a 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("/data/app");

        String[] files = appsDir.list();

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

        }
    }

它确实列出了我根植的 htc magic 和 emu 中的 apk.

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

这篇关于Android 是否保留 .apk 文件?如果是这样在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆