Closed Bug 1415690 Opened 2 years ago Closed 2 years ago

USB remote debugging broken on Android O

Categories

(GeckoView :: General, enhancement)

51 Branch
All
Android
enhancement
Not set

Tracking

(firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: esawin, Assigned: esawin)

Details

Attachments

(1 file)

In bug 1401002 we've enabled remote debugging of GeckoView via USB.
On Android O, the device shows up in WebIDE, however connecting to it fails with following error log:

E adbd    : failed to connect to socket 'localfilesystem:/data/user/0/org.mozilla.fennec_esawin/firefox-debugger-socket-1': Permission denied
ApplicationInfo.dataDir returns "data/user/0/<package>" which is a symlink to "data/data/<package>" but owned by root instead of system, which seems to cause a permission issue when connecting through adbd.

Resolving the symlink before passing it to the DebuggerServer solves the issue.
Attachment #8926585 - Flags: review?(snorp)
Comment on attachment 8926585 [details] [diff] [review]
0001-Bug-1415690-1.0-Resolve-canonical-data-path-to-avoid.patch

Review of attachment 8926585 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/geckoview/src/main/java/org/mozilla/gecko/GeckoSession.java
@@ +476,5 @@
>                      mSettings.getBoolean(GeckoSessionSettings.USE_MULTIPROCESS);
>              preload(appContext, /* geckoArgs */ null, multiprocess);
>          }
>  
>          if (mSettings.getString(GeckoSessionSettings.DATA_DIR) == null) {

Hmm, why is this a setting? Is there a reason we'd want this to be set to anything other than what it is below?
Attachment #8926585 - Flags: review?(snorp) → review+
(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) from comment #2)
> Hmm, why is this a setting? Is there a reason we'd want this to be set to
> anything other than what it is below?

The original setting for this was DEBUGGER_SOCKET_DIR which should be configurable for the app and overrides the provided DATA_DIR setting in the remote debugger.
Having both as a setting is just a consistent and convenient way to pass them to the JS modules and to keep track of updates automatically.
Pushed by esawin@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/3ea95e09f4b3
[1.0] Resolve canonical data path to avoid permission issues. r=snorp
https://hg.mozilla.org/mozilla-central/rev/3ea95e09f4b3
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 58
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 58 → mozilla58
You need to log in before you can comment on or make changes to this bug.