Archives: June 2018

2 articles

Accessing your application database from Android Studio

Open the Terminal window (Alt + F12) or:

Open the Terminal window

Then list your devices with the adb command. This will display both running emulators and connected devices:

$ adb devices
List of devices attached
emulator-5554   device

Use the device name to open a connection:

$ adb -s emulator-5554 shell
generic_x86:/ $

To avoid a Permission denied error while trying to access your application files, use the run-as command:

generic_x86:/ $ run-as com.your.package.example sqlite3 databases/yourdatabase.db

[PCManFM] Unable to find or create trash directory

This error happened when I tried to trash files located on a secondary drive, which is automatically mounted at startup in my /etc/fstab.

To fix this, I manually created a hidden .Trash-1000 folder at the root of the mounted folder, and made it belong to my user:

sudo mkdir /path-to-mounted-drive/.Trash-1000
sudo chown your-username .Trash-1000

1000 is the uid of my user. This is the default value but you can find yours with the id command:

$ id                                               
uid=1000(didier) gid=100(users) groups=100(users)[...]