We're looking for a user researcher to understand the needs of developers and designers. Is this you or someone you know? Check out the post: https://mzl.la/2IGzdXS

この翻訳は不完全です。英語から この記事を翻訳 してください。

B2G 端末のテストを実施するためには、あなたのマシンにUSB経由で接続された端末が必要になるでしょう。適切に接続されているかを検証するには、次の手順を実行できます:


[Settings > Device Information > More Information >  Developer > Remote debugging] がオンになっているのを確認します。

端末をコンピュータに接続して、adb devices で出てくるのを確認し、次に adb の Marionette ポートへのポートフォワーディングを設定します:

$ adb devices
List of devices attached
full_unagi    device

$ adb forward tcp:2828 tcp:2828

$ telnet localhost 2828
Connected to localhost.
Escape character is '^]'.
  "from": "root",
  "applicationType", "gecko",
  "traits": []

If you see the above output, Marionette is running on your device.


The most common way of running tests on an emulator is to allow Marionette to launch the emulator and manage the connection for you.  However, it's still possible to launch the emulator manually yourself, using the run-emulator.sh script in the B2G repo, and then connect to it using the above directions.

デスクトップ版 B2G ビルドでは

On a b2g desktop build, you don't need to worry about adb port forwarding.  If you have a Marionette-enabled build, Marionette should be available on port 2828 after launching it.


It's a big PITA to debug things on the emulator/device, but you can use log4moz and the Marionette logger to print some statements if you are stuck.

 let logger = Log4Moz.repository.getLogger("Marionette");
 logger.info("I'm being logged!");

To view the log, do this, while the instance is running:

 $B2G_HOME/glue/gonk/out/host/linux-x86/bin/adb shell cat /data/b2g/mozilla/<your profile>/marionette.log


このページの貢献者: Uemmra3
最終更新者: Uemmra3,