From 40cfa62c2db566275801d10c7d5726511a426ed7 Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 6 Apr 2023 16:56:14 +0000 Subject: [PATCH] android readme: update "access datadir on Android from desktop" Added a section re pushing wallet to device. It is surprisingly tricky, but using specifically the "/data/local/tmp" folder as an intermediary, it works. --- contrib/android/Readme.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/contrib/android/Readme.md b/contrib/android/Readme.md index 059370fb3..92f57d20a 100644 --- a/contrib/android/Readme.md +++ b/contrib/android/Readme.md @@ -126,12 +126,21 @@ and [android dev docs](https://developer.android.com/studio/build/building-cmdli Note that this only works for debug builds! Otherwise the security model of Android does not let you access the internal storage of an app without root. (See [this](https://stackoverflow.com/q/9017073)) +To pull a file: ``` $ adb shell -$ run-as org.electrum.electrum ls /data/data/org.electrum.electrum/files/data -$ exit # to exit adb +adb$ run-as org.electrum.electrum ls /data/data/org.electrum.electrum/files/data +adb$ exit $ adb exec-out run-as org.electrum.electrum cat /data/data/org.electrum.electrum/files/data/wallets/my_wallet > my_wallet ``` +To push a file: +``` +$ adb push ~/wspace/tmp/my_wallet /data/local/tmp +$ adb shell +adb$ ls -la /data/local/tmp +adb$ run-as org.electrum.testnet.electrum cp /data/local/tmp/my_wallet /data/data/org.electrum.testnet.electrum/files/data/testnet/wallets/ +adb$ rm /data/local/tmp/my_wallet +``` Or use Android Studio: "Device File Explorer", which can download/upload data directly from device (via adb).