android从Marketplace安装应用程序后,是否保留。apk文件?

Android是否有一个保存这些文件的标准位置?


当前回答

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).

如果你只是在shell中闲逛,目前非前向锁定的应用程序位于/data/app/.apk中。shell用户可以读取特定的.apk,但不能列出目录。在未来的版本中,命名约定将略有改变,所以不要指望它保持不变,但如果您从包管理器中获得.apk的路径,那么您可以在shell中使用它。

其他回答

当我在模拟器上安装我的应用程序时,它显示了我的.apk文件

数据/应用 然后我用了 Ls data/app //查看它是否存在或 不

安装应用程序后,只需使用ls命令vie shell并检查所需的目录,但这取决于你要安装的应用程序类型。我使用这种方法安装 如果有什么地方不对就指出来。

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).

如果你只是在shell中闲逛,目前非前向锁定的应用程序位于/data/app/.apk中。shell用户可以读取特定的.apk,但不能列出目录。在未来的版本中,命名约定将略有改变,所以不要指望它保持不变,但如果您从包管理器中获得.apk的路径,那么您可以在shell中使用它。

如果你正在寻找一个特定应用程序的路径,一个快速而肮脏的解决方案是grep bugreport:

$ adb bugreport | grep 'dir=/data/app' 

我不知道这将提供一个详尽的列表,所以它可能有助于首先运行应用程序。

如果你是根用户,下载根资源管理器。为根用户提供的最佳文件管理器。 不管怎样,System/app有手机自带的所有默认apk, data/apk有你已经安装的所有应用的apk。只要长按你想要的apk(在根资源管理器中),找到你的/sdcard文件夹,然后粘贴。

如果你使用eclipse goto DDMS,然后文件资源管理器,你会看到System/Apps文件夹和apks在那里