截取设备当前屏幕的屏幕截图
当一个人想要在 Play 商店(以前称为 Android Market)上发布他的应用程序时,他可以上传他的应用程序的屏幕截图。我想用我当前用来测试应用程序的设备(摩托罗拉 Droid)截取这些屏幕截图。
Play商店里有一些应用程序可以让你截图,但你必须root你的手机,我不想这样做。 Stack Overflow 中有一些相关主题,人们希望从代码中截取屏幕截图(此处)。不过,我只想使用当前设备截取正在运行的应用程序的屏幕截图,该设备通过 USB 连接到我的计算机;我正在通过 Eclipse 进行开发,因此应该有一种方法可以告诉您正在运行的设备应该通过 SDK 进行屏幕截图,对吗?
一些网站(例如 LifeHacker)提到了一种方法来做到这一点,
要截屏,您需要在设置下启用USB调试,安装Android软件开发套件,然后使用调试工具连接到手机
但他们没有解释我实际需要执行的步骤-步。
如果有人能帮助我,我将非常感激。
When one wants to publish his app on the Play Store (previously known as Android Market), he can upload screenshots of his app. I would like to take these screenshots with my current device (Motorola Droid) that I'm using to test the application.
There are some apps on the Play Store that allow you to take screenshots, but you have to root your phone, which I don't want to. There are related topics within Stack Overflow where people want to take screenshots out of there code (here). However I just want to take screenshots of my running app with the current device, which is connected via USB to my computer; I'm developing via Eclipse, so there should be a way to tell your running device that it should take a screenshot via the SDK, right?
Some website (e.g. LifeHacker) mention a way to do this,
To take a screenshot, you'll be required to enable USB Debugging under the settings, install the Android software development kit, and then connect to the phone with a debug tool
but they don't explain what I actually need to do step-by-step.
I would really appreciate if someone can help me out.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
由于您可能是一名开发人员,因此您拥有用于运行 Android 应用程序的 SDK 和工作 Eclipse。只需插入手机,并确保在手机上启用 USB 调试,设备需要显示在 Eclipse 的 DDMS 透视图中。
一旦您的设备显示在
DDMS
透视图中,就会出现用于捕获屏幕的图标。Since you probably are a developer, you have SDK and working Eclipse for running Android applications. Just plug in the phone, and make sure you enabled on the Phone the USB Debugging, the device needs to show up in the
DDMS
perspective of Eclipse.Once your device shows up in the
DDMS
perspective there is in icon there to capture the screen.如果您已经在使用 Eclipse 开发应用程序,那么您已经安装了 Android 软件开发工具包。因此,只需打开
sdk-android/tools
目录中的ddms
实用程序即可。在那里,您可以通过选择设备并按:Ctrl+S(设备 -> 屏幕截图...)来截取屏幕截图。ddms
看起来像:If you are already using Eclipse to develop your app, then you already have the Android software development kit installed. So, just open the
ddms
utility that is on thesdk-android/tools
directory. There, you can take screenshots by selecting your device and pressing: Ctrl+S (Device -> Screen capture…).ddms
looks like:Android SDK 附带了一个工具,可以帮助您在设备连接到计算机时进行屏幕截图。我将解释两者。首先,您需要将设备插入计算机并让 adb 识别它(又名,当您运行“adb devices”时,它会显示您的手机)。
然后您可以使用 Eclipse 或 DDMS:
DDMS
打开 ddms。
在左侧列表中单击您的设备。
进入菜单设备-->屏幕捕获。
Eclipse
打开 Eclipse。
打开“设备”视图。您可以通过 Window --> 访问它显示视图 -->其他... -->安卓-->设备。
单击您的设备。
在设备视图中,右上角有一个小图片。如果将鼠标悬停在其上,它会显示“屏幕捕获”。单击该按钮。
这两种方法都会引导您使用相同的捕获屏幕截图的工具。有时它可能会有点问题 - 有时我需要关闭/重新打开窗口才能获取屏幕截图。
There's a tool that the Android SDK comes with to help you take screenshots if your device is connected to the computer. I'll explain both. First, for both you need to plug your device into the computer and have it be recognized by adb (aka, when you run "adb devices" it shows your phone).
Then you can either use Eclipse or DDMS:
DDMS
Open ddms.
Click on your device in the list on the left.
Go to the menu Device --> Screen Capture.
Eclipse
Open Eclipse.
Open the "devices" view. You can get to it via Window --> Show View --> Other... --> Android --> Devices.
Click on your device.
In the Devices view, there's a little picture in the upper right corner. If you hover your mouse over it it says "Screen Capture." Click that.
Both methods lead you to the same tool which captures screenshots. Sometimes it can be a little buggy - occasionally I need to close/reopen the window in order to get it to take a screenshot.
只是注意到 ddms 已被弃用,该功能现在可以在监控工具 (tools/monitor) 中使用。
从控制台窗口打开监视器,然后在左侧面板中选择设备。单击上面的相机(屏幕捕获)图标,您将看到当前屏幕。然后您可以根据需要旋转并复制或保存图像。如果您要保存多个镜头或第一次没有得到您想要的内容,刷新将获取免费的屏幕截图。
Just noting that ddms is deprecated and this function is now available in the monitor tool (tools/monitor) instead.
Open monitor from a console window and select the device in the left panel. Click the camera (Screen Capture) icon above and you'll see the current screen. Then you can rotate if needed and copy or save the image. Refresh will grab a free screen grab in case you are saving multiple shots or didn't get what you wanted the first time.