r/androiddev • u/mohitagarwal92 • Aug 04 '17
TIL: You can access connected Android device's file explorer from Android Studio itself.
http://imgur.com/a/le0Fc7
Aug 04 '17
Can you open the data folder? Because if you cant, its kinda not very useful.
9
u/gentoozer Aug 04 '17
Yes you can, unlike the file file explorer of android device monitor.
This saves some time by not doing run-as package in the device shell
3
2
u/lordVader1138 https://prashamhtrivedi.in/ Aug 05 '17
It works only on Debug apps. I can see data>data directory, but further expansion only happens for Debug mode apps.
Like your own apps you develop or Nova launcher's companion app(Nova launcher has Google Now support, it works for any launcher other then GNL if other launcher is System app or has Debug app, Nova launcher distributes a separate debug app to have google launcher), you can see shared prefs of that debug app in file explorer
1
u/incorporateapps Aug 05 '17
what if the device is rooted, can you open everything? System and data on all apps?
1
u/lordVader1138 https://prashamhtrivedi.in/ Aug 06 '17
Haven't tried, to be frank. What I know is they use
run-as packagecommand to open directories.1
13
u/redditsoaddicting Aug 04 '17
That's interesting considering there's no good API that I know of to do that. AFAIK, they'd have to run commands like ls and parse the output (which I wouldn't trust to be in the same format on every phone) to build up the directory structure.
8
u/AndrewNeo Aug 05 '17
It's not exposed through the command line but the sync command's internal mechanism has some stuff for ls-ing
6
u/der_RAV3N Pixel 2 | Nexus 7 | Nexus 4 Aug 04 '17
God, I hope there will be a proper support for file exploring on Mac some time. Windows is quite okay, but also has it's flaws. But you even need an extra program for Mac.
5
u/russjr08 Beginner Dev Aug 05 '17
Which had the really nice side effect of crashing the whole Mac out of random for a while...
2
1
1
u/djiboutiivl Aug 30 '17
Heads up that any modifications are to local files, and you have to right-click on the containing folder and re-uploading (i.e. "push") the file back to the emulator/device. Kind of annoying. You'd think it would have an option to push when saving locally, but at least it's something...
-1
u/lordVader1138 https://prashamhtrivedi.in/ Aug 05 '17
This was one of the WHOA addition in Android Studio 2.4 preview, right now they have all 2.4 changes in 3.0...
23
u/instantbitsapps Aug 04 '17
Is that only for the new version? I don't see that on mine (2.3.3).