如何查看androidjava程序手动创建的文件

How to view file manually created by android java program

我使用

创建了一个文件
` try {
            File myFile = new File("myfile");
            if (myFile.exists())
                myFile.delete();
            outputStream = openFileOutput("myfile", Context.MODE_PRIVATE);
            Log.d("MyServiceActivity", "file written");
            outputStream.write(User.getInstance().getUserId().getBytes());
            outputStream.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
`

如何查看手动创建的文件。提前致谢

由于文件是用 Context.MODE_PRIVATE 保存到内存中的,如果你没有 root 权限,你将无法用你的 phone

查看这个文件

查看文件的最佳方法是打开位于 Android Studio IDE

中的 device monitorAndroid monitor

Note: run your app in debug mode to be able to see internal memory directories and files !

请务必将您的设备插入电脑以 运行

编码愉快