Can I connect to sailfish x device with adb?

Hello!
Is there a way to run adb commands to my XA2 device in which I have flashed Sailfish X? I mean, either running adb from a linux host computer or by running adb directly on the device. I have seen some old threads in together.jolla.com but they all assume that there are stuff in /opt/alien/ directory in the device, I only have system.img there.
My end goal is to try to change the default Android webview implementation with this command (taken from here):
adb shell cmd webviewupdate set-webview-implementation <packagename>
And my motivation is this issue with lichess app: https://github.com/veloce/lichobile/issues/1137

Thank you in advance!

Why would you not jave anything in /opt/alien? That’s where the Android system files are… (or is this a new thing with the new Aliendalvik? I’m using X, so not )sure

Yes, this is new for the ‘new’ aliendalvik 8.1.
Under /opt/alien you will find only a packed image file.
Reason why integrating G…gle stuff is a bit more tricky, find it on TJC
https://together.jolla.com/question/200169/howto-install-gapps-on-sailfish-x-xperia-xa2/

I do use built-in package-verification-disabling and MicroG
see for reference only (read the update!):
https://together.jolla.com/question/200448/how-to-install-microg-on-xa2-android-81/

1 Like

You can get a shell with (as root) lxc-attach aliendalvik -- /system/bin/sh, but webviewupdate does not seem to exist.

Alternatively you can try installing Aliendalvik Control, go to Android settings and select webview as instructed in https://chromium.googlesource.com/chromium/src/+/HEAD/android_webview/docs/prerelease.md#android-7-through-9-nougat_oreo_pie

2 Likes

Thank you for your answers, I’ve had some progress!
Within the lxc-attach sh shell, I was able to start adbd. Then, I had to copy my adbkey.pub contents (from my linux host) in an adb_keys file inside the aliendalvik container (had to run lxc-attach again in a separate terminal window), in path /data/misc/adb. Afterwards, I was able to run adb connect from my linux host and the device was seen and authorized!
As for the webview part, trying to set the webview implementation to something other than the default gives:

~$ adb shell cmd webviewupdate set-webview-implementation com.android.chrome
Failed to switch to com.android.chrome, the WebView implementation is now provided by com.android.webview.

Any ideas?
@artur I have Aliendalvik Control installed, but the webview setting is hidden inside the Android developer options… is there a way to open Android Developer options in Sailfish X? (Tapping on Build Number several times does nothing)

1 Like