1
0

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.
This commit is contained in:
SomberNight
2023-04-06 16:56:14 +00:00
parent c0f8986188
commit 40cfa62c2d

View File

@@ -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).