sách gpt4 ai đã đi

Cách tìm ứng dụng/dữ liệu/dữ liệu của tôi bằng trình khám phá tệp của Android Device Monitor

In lại 作者:塔克拉玛干 更新时间:2023-11-01 21:42:31 31 4
mua khóa gpt4 Nike

我有一个应用程序可以将文本文件写入内部存储。我想仔细看看我的电脑。

我运行了 Toast.makeText 来显示路径,它说:/数据/数据/我的包

但是当我转到 Android Studio 的 Android Device Monitor 应用程序时,我在文件资源管理器中看不到/data/data。那么我的文件在哪里?

我知道它们存在,因为我可以在 adb shell 上找到它们。我需要将/data/data 转换为文件资源管理器上可见的路径,以便我可以轻松下载它们。谢谢!

1 Câu trả lời

您只能检查是否有 root 手机,因为这些文件夹对应用程序是私有(private)的,并且通常访问仅限于这些文件夹。如果您没有 root 手机,我会建议您复制一份内部文件夹并将它们写入您的 SDCard 以检查内容。另一种方法是对手机进行 root 或使用模拟器。

这是您可以用来在外部 SDCard 上写入副本的代码:

public static void copyDirectoryOneLocationToAnotherLocation(File sourceLocation, File targetLocation)
throws IOException {

if (sourceLocation.isDirectory()) {
if (!targetLocation.exists()) {
targetLocation.mkdir();
}

String[] children = sourceLocation.list();
for (int i = 0; i < sourceLocation.listFiles().length; i++) {

copyDirectoryOneLocationToAnotherLocation(new File(sourceLocation, children[i]),
new File(targetLocation, children[i]));
}
} khác {

InputStream in = new FileInputStream(sourceLocation);

OutputStream out = new FileOutputStream(targetLocation);

// Copy the bits from instream to outstream
byte[] buf = new byte[1024];
int len;
while ((len = in.read(buf)) > 0) {
out.write(buf, 0, len);
}
ghim theo();
ra ngoài.đóng();
}

}

关于android - 如何使用 Android Device Monitor 的文件资源管理器查找我的应用程序/数据/数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25616985/

31 4 0
Bài viết được đề xuất: android - Android 的 Kiosk 模式
Bài viết được đề xuất: java - Java中的按位运算子串
Bài viết được đề xuất: ios - '[CLPlacemark] ?' is not convertible to ' [CLPlacemark]' -> swift2
Bài viết được đề xuất: Java 继承示例
Giấy chứng nhận ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com