android从Marketplace安装应用程序后,是否保留。apk文件?
Android是否有一个保存这些文件的标准位置?
android从Marketplace安装应用程序后,是否保留。apk文件?
Android是否有一个保存这些文件的标准位置?
当前回答
预安装的应用程序在/system/app文件夹下。用户安装的应用程序在/data/app中。我猜除非你的手机有根密码,否则你无法访问。 我没有一个根电话在这里,但尝试这段代码:
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]);
}
}
它确实列出了apks在我的根htc魔术和在emu。
其他回答
预安装的应用程序在/system/app文件夹下。用户安装的应用程序在/data/app中。我猜除非你的手机有根密码,否则你无法访问。 我没有一个根电话在这里,但尝试这段代码:
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]);
}
}
它确实列出了apks在我的根htc魔术和在emu。
安装Total Commander。 在主页面打开已安装的应用程序。
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中使用它。
在/data/app中,但出于复制保护,我认为你不能访问它。
如果你只是想获得你之前安装的东西的APK文件,请这样做:
从谷歌Play获取AirDroid 使用AirDroid从您的PC网络浏览器访问您的手机 进入应用程序,选择已安装的应用程序 点击“下载”按钮,从您的手机下载此应用程序的APK版本
您不需要对您的手机进行根操作,不需要使用adb,也不需要编写任何东西。