使用裝置檔案探索工具查看裝置上的檔案
「裝置檔案總管」可讓您在 Android 裝置上查看、複製及刪除檔案。檢查應用程式建立的檔案,或將檔案傳輸至裝置時,這項功能非常實用。
注意: 除非使用已解鎖的裝置,或是具有標準 Android (AOSP) 系統映像檔的模擬器 (而非 Google API 的其中一個或 Google Play 系統映像檔),否則大部分的裝置資料都不會顯示。使用已連結的裝置時,請務必啟用 USB 偵錯功能 。 如要使用裝置的檔案系統,請按照下列步驟操作:
依序按一下「View」>「Tool Windows>「Device File Explorer」 ,或按一下工具列中的「Device File Explorer 」 按鈕,開啟 Device File Explorer。
從下拉式清單中選取裝置。
在檔案總管視窗中與裝置內容互動。在檔案或目錄中按一下滑鼠右鍵,即可建立新的檔案或目錄、將選取的檔案或目錄儲存至您的電腦、上傳、刪除或進行同步處理。按兩下檔案即可在 Android Studio 中開啟檔案。
Android Studio 會將透過此方式開啟的檔案儲存在專案以外的臨時目錄中。如果您對使用裝置檔案總管開啟檔案進行修改,並且希望將變更儲存回裝置上,則必須手動將修改過的檔案上傳到裝置。
圖 1. Device File Explorer 工具視窗
探索裝置檔案時,下列目錄尤其實用:
data/data/app_name /
包含儲存在內部儲存空間 的應用程式資料檔案 sdcard/
包含儲存在外部使用者儲存空間 (相片等) 的使用者檔案。
注意: 硬體裝置上的部分檔案不會顯示在裝置檔案總管中。舉例來說,在 data/data/
目錄中,無法偵錯的對應應用程式的登錄,無法在裝置檔案探索工具中展開。
Content and code samples on this page are subject to the licenses described in the Content License . Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2022-07-18 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"缺少我需要的資訊"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"過於複雜/步驟過多"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"過時"
},{
"type": "thumb-down",
"id": "translationIssue",
"label":"翻譯問題"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"示例/程式碼問題"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"其他"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"容易理解"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"確實解決了我的問題"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"其他"
}]