如何在android中正确编写文件,使其可供ADB使用?
实际上,我有一个应用程序,通过接收特定的意图来编写一个特定的txt文件,其中包含一个写入的跟踪 要编写该文件,我使用以下方法如何在android中正确编写文件,使其可供ADB使用?,android,file,adb,Android,File,Adb,实际上,我有一个应用程序,通过接收特定的意图来编写一个特定的txt文件,其中包含一个写入的跟踪 要编写该文件,我使用以下方法 public void write(String data, Context context,String filename) { try { OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput(filename, Context
public void write(String data, Context context,String filename) {
try {
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(context.openFileOutput(filename, Context.MODE_PRIVATE));
outputStreamWriter.write(data);
outputStreamWriter.close();
} catch (IOException e) {
Log.e("Exception", "File write failed: " + e.toString());
}
}
直到这里一切都很好,文件已经写好了,但现在我需要通过ADB拉那个文件,问题来了。由于OutputStreamWriter
设置为Context.MODE\u PRIVATE
adb pull命令无法找到该文件,因此哪种方法是将该文件写入“public”目录并通过adb提取该文件的最佳方法
ADB命令将从VB.NET程序发送