0

How do I test-install a packaged (zip) app on Fennec?

Device: Physical Android phone or Android emulator, I don't care.

feklee
  • 7,555
  • 9
  • 54
  • 72

1 Answers1

4

Install mozilla-apk-cli using NPM:

npm install -g mozilla-apk-cli

Use it to generate a "debuggable" APK for your app from either a source directory or a URL to the mini-manifest:

mozilla-apk-cli /path/to/source/dir/ arbitrary-name.apk
mozilla-apk-cli http://example.com/path/to/mini/manifest.webapp arbitrary-name.apk

(Context-click > Inspect Element on the "Free" button in Marketplace to discover the mini-manifest URL for an app in the Marketplace.)

Install the APK on your Android device:

adb install -r arbitrary-name.apk

Launch the app on the device. Look to the notification area for a notification about which port the remote debugger server is listening on. Forward that port on your desktop, f.e. if the port is 12345:

adb forward tcp:12345 tcp:12345

Go to Web Developer > Connect… in Firefox on your desktop and connect to localhost at the forwarded port. Commence debugging!

Notes:

jamesh
  • 19,863
  • 14
  • 56
  • 96
Myk Melez
  • 1,080
  • 7
  • 9
  • Because I "need more than 10 reputation to post more than 2 links", here are some links I had to leave out: [mozilla-apk-cli](https://github.com/mozilla/apk-cli), [Nightly builds of Fennec](http://nightly.mozilla.org/), [Bug 929382](https://bugzilla.mozilla.org/show_bug.cgi?id=929382). – Myk Melez Jun 23 '14 at 18:39
  • Thanks, that works! Only `mozilla-apk-cli` has [a bug](https://github.com/mozilla/apk-cli/issues/2) in that it doesn't like paths with spaces. – feklee Jun 23 '14 at 21:44