MDN’s new design is in Beta! A sneak peek: https://blog.mozilla.org/opendesign/mdns-new-design-beta/

在许多场合下截屏都是非常有用的,例如将你的工作展示给客户端或者在 Marketplace 中发布应用。本文则对在 Firefox OS 手机中如何截屏进行了说明。

Note: Android 会觉得非常熟悉。这些步骤都是类似的。

准备你的手机

  1. 在手机上到 Developer Settings  查看远程调试和终端是否使能
  2. 确保你的手机已经  ADB installed 并且正常工作
  3. 通过 USB 将手机连接到电脑

截屏

你当前可以有 4 种方式可以实现: 使用终端,在 Eclipse 中使用 DDMS, 在手机上使用手机上的组合按键,或者使用 App Manager。

终端

打开一个终端窗口,依次输入下面 3 个命令:

  1. 使用下面的命令截屏(如果你想要称之为其他的名称,可以修改 screenshot.png
    adb shell screencap -p /sdcard/screenshot.png
  2. 从电脑中获取图片:
    adb pull /sdcard/screenshot.png
  3. 在设备中删除截屏图片
    adb shell rm /sdcard/screenshot.png

Alternatively, you can use ffmpeg:

  1. Make sure you have ffmpeg installed:
    1. On Mac, if you use MacPorts, you can do this with sudo port install ffmpeg. For homebrew, do brew install ffmpeg.
    2. On Linux (Ubuntu/Debian), use sudo apt-get install ffmpeg.
  2. cd into the B2G/gaia directory.
  3. Use the make screenshot command to take a screenshot.
  4. You now have a screenshot called screenshot.png.

DDMS

Open Eclipse.

  1. Open DDMS: Window > Open Perspective > Other > DDMS.
  2. On the left side panel, in the Devices tab, click the Screen capture button.
  3. A new window appears with several options; click on Save button to save your screenshot.

Note: To learn more about DDMS, have a look at the DDMS documentation .

Phone button combination

  1. On Firefox OS versions up to 2.0, simultaneously hold down the Home and Power buttons for a few seconds.
  2. On Firefox OS version 2.1 and beyond, simultaneously hold down the Volume Down and Power buttons for a few seconds.

This takes a screenshot, which is saved in your Gallery. You can now copy the picture from your SDCard to your computer using whatever method suits you best.

Note: The button combination change was made because many people feel that Home and Power is more difficult to do that it should be, especially with one hand, plus devices with no hardware Home button are not very well supported (you can't use a software Home button in many places in Gaia, such as the lock screen.)

App Manager/Simulator

  1. Go to the App Manager, connect to your phone, and navigate to the Device tab on the left.
  2. Click on the Screenshot button at the bottom of the page (is at the same place that you startes the simulator).

文档标签和贡献者

标签: 
 此页面的贡献者: chrisdavidmills, ReyCG_sub
 最后编辑者: chrisdavidmills,