Error testing addon with web-ext in Android. Unable to retrieve current user

I’m developing an addon for Firefox that works fine in desktop. I’m trying now to test it in Android via web-ext but I get an error when I run the command:

web-ext run --target=firefox-android --android-device=55555555 --firefox-apk=org.mozilla.fenix

The error is:

WebExtError: Unable to retrieve current user on 55555555
    at ADBUtils.getCurrentUser (file:///usr/lib/node_modules/web-ext/lib/util/adb.js:72:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ADBUtils.discoverInstalledFirefoxAPKs (file:///usr/lib/node_modules/web-ext/lib/util/adb.js:77:20)
    at async FirefoxAndroidExtensionRunner.apkPackagesDiscoveryAndSelect (file:///usr/lib/node_modules/web-ext/lib/extension-runners/firefox-android.js:257:22)
    at async FirefoxAndroidExtensionRunner.run (file:///usr/lib/node_modules/web-ext/lib/extension-runners/firefox-android.js:76:5)
    at async Promise.all (index 0)
    at async MultiExtensionRunner.run (file:///usr/lib/node_modules/web-ext/lib/extension-runners/index.js:67:5)
    at async run (file:///usr/lib/node_modules/web-ext/lib/cmd/run.js:173:3)
    at async Program.execute (file:///usr/lib/node_modules/web-ext/lib/program.js:270:7)
    at async file:///usr/lib/node_modules/web-ext/bin/web-ext.js:13:1

Do you have USB debugging enabled on the Android?
https://developer.android.com/studio/debug/dev-options#Enable-debugging

Comparing to my setup, I have web-ext installed globally, which is recommended way: https://extensionworkshop.com/documentation/develop/getting-started-with-web-ext/

And lastly, you’ve probably seen this, but just in case, there is a setup article:

Yes, thank you. I have read all the documentation but I must be missing something. I have tested on Arch and on Fedora. Web-ext installed from repo and with npm globally. USB debugging enabled on the Android. adb devices shows “device”

I have found the problem by myself. My Android version is not supported by web-ext. I have created an issue in web-ext github https://github.com/mozilla/web-ext/issues/3315. For anyone else in this situation I have left a temporary solution there.

Thanks for the update!

Note that unless it’s trivial, I don’t think support for Android 6 will be added (because it’s 9 years old and already 6 years unsupported).

Although it’s not my area of expertise, in general, maintaining support for old unsupported software can be quite challenging, and many programmers avoid it as much as possible.

Also, due to missing security patches in such an old OS, I would strongly recommend upgrading your device :slight_smile:.

2 Likes