Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Android / How to access the files for your Android project on your device WITHOUT rooting it

Author
Message
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 31st May 2013 20:07
This was making me crazy. I wanted to be able to create a log in my app to show some stuff and then look at it.

And nothing I did would let me find the package on any of my devices!

But I finally found a way after trying different google searches.

First, you open an adb command session on your device (assumes only one device connected):
1. Connect your device via USB (and have USB debugging turned on, of course)
2. Open a DOS Prompt command window on your PC (if not readily available, open the Start panel on Windows, type 'cmd' into the 'Search programs and files' input and press return, right click and pin to start menu {for later convenience}, click on it to start {you might need to use 'run as administrator' from the right click menu})
3. Navigate to C:\Android\android-sdk\platform-tools (assumes you have the Android SDK installed there, if not, change the path accordingly)
4. Type in 'adb shell' and hit the enter key

You should now see 'shell@android:/ $' on your screen.

If you enter 'll' (el el, not one one) it will show a bunch of stuff. One of which is the data directory, which is our target. But you cannot access it if you are unrooted.

But you can access your app like by typing in the command 'run-as com.yourcompany.yourapp'. (Naturally, you replace com.yourcompany.yourapp with the actual package name for your app.)

Once you do that, the prompt changes to 'shell@android:/data/data/com.yourcompany.yourapp $'.

Doing the list command (ll) now shows cache, files and probably lib pointing to another directory.

Change to the files directory with the command 'cd files'.

The files directory is the one where you will find the temporary files created when your app runs and any files that you open and write to in your app.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 24th Jun 2013 23:14
That's a quite handy find. Nice work!

Login to post a reply

Server time is: 2024-04-20 15:00:31
Your offset time is: 2024-04-20 15:00:31