![](/img/trans.png)
[英]How to tackle Different values passed by android studio in debug and run mode caused by network connection check
[英]Create file and check it in debug mode in Android Studio
我正在使用android studio,并使用连接的设备(即手机)进行调试。 创建文件后我一直在徘徊,如何才能实际看到该文件。 我的意思不是以编程方式。
这是将xml文件复制到内部存储器的代码。 看来它已被复制,但我看不到并确认。 反正在Android Studio中有检查吗?
File file = new File("server.xml");
try {
Context context = getApplicationContext();
InputStream inputStream = context.getResources().openRawResource(R.raw.server);
FileOutputStream fileOutputStream = new FileOutputStream(file);
byte buf[]=new byte[1024];
int len;
while((len=inputStream.read(buf))>0) {
fileOutputStream.write(buf,0,len);
}
fileOutputStream.close();
inputStream.close();
} catch (IOException e1) {}
您可以这样做:
adb shell run-as your.package.name
cat files/server.xml
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.