Testing addons on Android

Hi,

I think I set everything up correctly to test my extension on Android Nightly:

When I run web-ext run -t firefox-android --adb-device R58MB63N2SE --firefox-apk org.mozilla.fenixfor this or any other extension, I get this error:

o: installTemporaryAddon: Error: Error: Could not install add-on at '/sdcard/web-ext-artifacts-1613228108658/i_don_t_care_about_cookies-3.2.8.xpi': [Exception... "Component returned failure code: 0x80520015 (NS_ERROR_FILE_ACCESS_DENIED) [nsIZipReader.open]"  nsresult: "0x80520015 (NS_ERROR_FILE_ACCESS_DENIED)"  location: "JS frame :: resource://gre/modules/addons/XPIInstall.jsm :: XPIPackage :: line 321"  data: no]
at /usr/lib/node_modules/web-ext/dist/web-ext.js:1:6007
at Client.handleMessage (/usr/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:162:7)
at Client.readMessage (/usr/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:221:10)
at Client.onData (/usr/lib/node_modules/web-ext/node_modules/@cliqz-oss/firefox-client/lib/client.js:187:16)
at Socket.emit (node:events:378:20)
at addChunk (node:internal/streams/readable:313:12)
at readableAddChunk (node:internal/streams/readable:288:9)
at Socket.Readable.push (node:internal/streams/readable:227:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

What am I missing here?
Thanks!

1 Like

Hi

I recommend that you follow this guide to test add-ons in Firefox for Android:

From the error it sounds like your Firefox for Android doesn’t have the “Storage” permission in Android. To check, go to the app details in settings and then make sure the Storage permission is granted.

1 Like

@Seburo I am able to successfully install the extension using collections, thanks! It works pretty much fine. But I am not able to test the version I’m currently developing like that.

@freaktechnik I checked. The app already had the storage permission granted.

1 Like

I remember it was a mess setting it up for the first time. But I know I’ve just followed one of the MDN tutorials and it worked. So maybe check these three:

  1. https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_with_WebIDE

  2. https://developer.mozilla.org/en-US/docs/Tools/about:debugging

  3. https://extensionworkshop.com/documentation/develop/developing-extensions-for-firefox-for-android/

…something about executing some ADB command that would trigger some permission on the Android…

Anyway, please maintain the Firefox 68 compatibility for now if you can :slight_smile:, thanks!

Unfortunately none of these links helped. Thanks anyway, Juraj!