2016-07-26 41 views
0

我正在使用android studio,並使用我的手機進行了調試。 我在創建文件後徘徊,我怎麼能看到這個文件。我的意思不是以編程方式。在Android Studio中創建文件並在調試模式下檢查

這裏是我的代碼將xml文件複製到我的內存。它似乎被複制,但我無法看到並確認。 無論如何在android工作室檢查?

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) {} 

回答

0

你可以這樣做:

adb shell run-as your.package.name 
cat files/server.xml 
相關問題