On a not rooted Android device you cannot view your app's file content. This might be necessary when dealing with files like databases, logs or downloads.
The guide was written for a windows machine, but the steps are the same for macOS as well.
To view the app's private content you need to
- backup the apk from the device
- convert the backup
- extract the convert backup
Backup the apk
In order to backup the apk you need the Android SDK tools.
- open a command prompt
- (optional, if Android SDK folder is included in PATH) navigate to the SDK installation folder where adb.exe is located, e.g. "C:\Users\Klaus\AppData\Local\Android\sdk\platform-tools"
- run the command:
- adb backup -f <backupname.ab> <apk package name>
<apk package name>: name of the apk you want to backup - <backupname.ab>: file name/path of the backup (it must end with .ab); if you not enter a path, the backup will most likely created in the adb.exe folder
- example: adb backup -f myAndroidBackup.ab com.mscmobile.sam.fatclient
- adb backup -f <backupname.ab> <apk package name>
- on the device: you will be asked to allow the backup, you can also enter a password (optional) which will encrypt the backup
Convert the backup
For this step you will need an external tool. I recommend using Android Backup Extractor which is a Java program and runs platform independent.
- open a command prompt
- navigate inside Android Backup Extractor folder
- run following command:
java -jar abe.jar unpack <backup.ab> <convertedBackup.tar> <password>- <backup.ab>: the file/path of your backup apk
- <convertedBackup.tar>: the name/path of the converted backup
- <password>: (optional): the password you specified when exporting the apk. omit if you did not specify a password
Extract the converted backup
To extract the .tar file use a unzipper of your choice, e.g. WinZip.
This way you can extract the content of your Android app without rooting your device.