截取 Wear 界面屏幕
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Wear OS 提供了多种截取 Wear OS 界面的方法:
-
Android Studio:使用 Logcat 截取屏幕截图。
-
配套应用:在 Google Pixel Watch 设备上,携带可穿戴设备
屏幕截图选项截取屏幕截图。
-
Wear OS 的屏幕录制功能:录制屏幕视频。
在 Android Studio 中截取屏幕截图
使用 Android Studio 截取穿戴式设备应用界面的屏幕截图与在移动设备上截取屏幕截图类似。请按照以下步骤操作:
- 在 Android Studio 中打开您的应用。
- 在设备或模拟器上运行您的应用。
- 前往您要在设备或模拟器中截取的屏幕。
- 打开 Logcat 并点击屏幕截图图标。该图标可能位于溢出菜单下。
- (可选)选择 Frame Screenshot,然后选择圆形 Chrome。
- 点击保存。
使用配套应用截取屏幕截图
如果你要截取 Google Pixel Watch 设备的屏幕截图,可以使用 Google Pixel Watch 配套应用。请按以下步骤操作:
- 在界面上,找到您要截取的屏幕。
- 在 Android 手机上,如果您尚未启用开发者选项,请依次选择设置 > 关于手机,然后点按版本号七次,将其启用。
- 在手机上打开 Wear 配套应用。
- 点按右上角的三点状溢出按钮以打开菜单。
- 点按抓取穿戴式设备屏幕截图。系统随即会显示以下消息:屏幕截图请求已发送。然后,您会收到以下通知:现在可以发送手表屏幕截图了。点按即可发送。
- 点按通知,以便界面中显示使用蓝牙、Gmail 或其他方式发送或分享屏幕截图的选项。
使用 Wear OS 的屏幕录制功能
如果在 macOS 上开发,您可以使用 GitHub 项目(即适用于 Mac 的 Android 工具)从 Wear OS 设备上录制视频。
或者,您也可以按照以下步骤从 Wear OS 设备上录制视频:
- 在手表上录制原始帧,如下所示:
adb shell screenrecord --time-limit 30 --output-format raw-frames --verbose /sdcard/video.raw
- 将原始文件复制到开发机器,如下所示:
adb pull /sdcard/video.raw video.raw
- 使用
ffmpeg
将原始文件转换为 MP4 文件,如下所示:
ffmpeg -f rawvideo -vcodec rawvideo -s 400x400 -pix_fmt rgb24 -r 10 -i video.raw -an -c:v libx264 -pix_fmt yuv420p video.mp4
注意:有关下载和安装说明,请访问 FFmpeg 网站。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[],[],null,["# Capture Wear UI screens\n\nWear OS provides several ways to capture the Wear OS UI:\n\n- **Android Studio**: use Logcat to take screenshots.\n- **Companion app** : on Google Pixel Watch devices, use the **Take wearable\n screenshot** option to take screenshots.\n- **Screen record for Wear OS**: record a video of the screen.\n\nCapture screenshots in Android Studio\n-------------------------------------\n\n\nCapturing screenshots of your wearable app's UI using Android Studio is similar to capturing\nscreenshots on mobile. Use the following steps:\n\n1. Open your app in [Android Studio](/studio).\n2. Run your app on a device or an emulator.\n3. Navigate to the screen you want to capture on the device or in the emulator.\n4. Open [Logcat](/studio/debug/am-logcat) and click the screenshot icon. It might be beneath the overflow menu.\n5. Optionally, select **Frame Screenshot** and select a round chrome.\n6. Click **Save**.\n\nCapture screenshots with the companion app\n------------------------------------------\n\n\nTo take screenshots of a Google Pixel Watch device, you can use the [Google Pixel Watch](https://play.google.com/store/apps/details?id=com.google.android.apps.wear.companion) companion app. Follow these steps:\n\n1. On your UI, find the screen that you want to capture.\n2. On the Android phone, enable **Developer options** , if you haven't already, by going to **Settings \\\u003e About phone** , and tapping **Build number** *seven times.*\n3. Open the Wear companion app on your phone.\n4. Tap the three dot overflow button in the upper-righthand corner to open the menu.\n5. Tap **Take wearable screenshot** . The following message appears: **Screenshot request sent** . Then you receive the following notifications: **Ready to send watch screenshot** and **tap to send**.\n6. Tap the notification to receive options for sending or sharing the screenshot using Bluetooth, Gmail, or other options.\n\nUse screen record for Wear OS\n-----------------------------\n\n\nIf you develop on macOS, you can use the GitHub project\n[Android tool for Mac](https://github.com/mortenjust/androidtool-mac/blob/master/README.md) to record a video from your Wear OS device.\n\n\nAlternatively, record a video from your Wear OS device using the following steps:\n\n1. Record raw frames on the watch, as shown in the following: \n\n ```text\n adb shell screenrecord --time-limit 30 --output-format raw-frames --verbose /sdcard/video.raw\n ```\n2. Copy the raw file to your development machine, as shown in the following: \n\n ```text\n adb pull /sdcard/video.raw video.raw\n ```\n3. Use `ffmpeg` to convert the raw file to MP4, as shown in the following: \n\n ```scdoc\n ffmpeg -f rawvideo -vcodec rawvideo -s 400x400 -pix_fmt rgb24 -r 10 -i video.raw -an -c:v libx264 -pix_fmt yuv420p video.mp4\n ```\n\n\n**Note:** Refer to the\n[FFmpeg website](https://www.ffmpeg.org/download.html) for download\nand installation instructions."]]