Automatic screenshot capture of the running android application for app store commitment

落花浮王杯 提交于 2019-12-06 09:06:41

问题


I've batchly generated a lot of apk install package, and I need to commit them to the android app store. Since the app store requires me to provide 3~4 pictures of the screenshot for the running application, and I don't wanna do this manually. So I'm trying to use some automation script. After some research I get the MIT sikuli UI interactive programming IDE which supports JPython.

The problem I got is that I need to uninstall my previously installed app or the installation process would fail with the "INSTALL_FAILED_INSUFFICIENT_STORAGE" error. I think the best way would be to run the uninstallation in the command line, and here comes the problem. The package name of the generated batched apks all starts with some same token, let's say "com.abc.efg", while differs with some minor numbers like "com.abc.efg_123_353" or "com.abc.efg_134_324", so I'm turning to some wild-char solution like "adb uninstall com.abc.efg*", but wild-char seems not be supported with the "adb" like command set. Any clue for this?


回答1:


An easier solution to take screeenshots without needing to do any compilation as david's solution required (for ICS devices only) is to use the following from the command line:

adb shell /system/bin/screencap -p /sdcard/screenshot.png
adb pull /sdcard/screenshot.png screenshot.png

This'll save the screenshot.png file in the current directory.

Tested on a Samsung Galaxy SII running 4.0.3.




回答2:


I've solved this with little trick. I preserve the previous installed package postfix, and every time I need to install a new one, I just call "adb uninstall" to remove the previous installed apk. As to the screenshot for the android device(emulator) in the command line, here is the solution by some guy.



来源:https://stackoverflow.com/questions/10764116/automatic-screenshot-capture-of-the-running-android-application-for-app-store-co

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!