Open Bug 1622958 Opened 9 months ago Updated 9 months ago

Add a way to specify environment variables on Android

Categories

(Testing :: mozregression, enhancement)

Version 3
enhancement
Not set
normal

Tracking

(Not tracked)

People

(Reporter: botond, Assigned: botond)

Details

On desktop, mozregression automatically propagates environment variables to the Firefox process it invokes. For example, if I run:

$ MOZ_LOG="apz.controller:5" mozregression -B debug -P stdout --launch 2020-03-16

mozregression will launch today's debug build and it will produce logging for the "apz.controller" module at verbosity "5".

On Android there does not appear to be a way to do this. It would be nice to add one.

We may not want to enable automatic propagation of environment variables like for desktop, but there could be a flag along the lines of --setenv MOZ_LOG="apz.controller:5".

Note that test harnesses like mochitest and reftest support this:

  --setenv NAME=VALUE   Sets the given variable in the application's
                        environment.

and it works on Android, so there is support for this at some layer.

Looks like there is support for this in mozdevice, and the way to engage it would be to pass a moz_env parameter to the launch_activity() call.

(In reply to Botond Ballo [:botond] from comment #2)

Looks like there is support for this in mozdevice, and the way to engage it would be to pass a moz_env parameter to the launch_activity() call.

I hacked a local mozregression build to pass in such a parameter, but it didn't seem to have the intended effect of activating logging. I'm not sure why.

(In reply to Botond Ballo [:botond] from comment #3)

I hacked a local mozregression build to pass in such a parameter, but it didn't seem to have the intended effect of activating logging. I'm not sure why.

The issue seems to be that I was unnecessarily quoting the env var's value, which seems to mess things up (I guess mozdevice handles quoting if necessary itself). With the quotes removed, it works fine.

Assignee: nobody → botond
You need to log in before you can comment on or make changes to this bug.