Taking screenshots for Ouya store submission

I’ve been building an OUYA game for a while now, and i’m very close to a version 1.0. The only thing i need for submitting the game to the OUYA store at this point, is a couple of screenshots. Sounds easy, but it’s not.

I’ve tried using the Corona SDK screenshot functions, like display.captureScreen( true ), but it doesn’t seem to be doing much. It just puts a screenshot of the game over all the other objects, and doesn’t seem to save a file anywhere.

Other solutions, like the use of screenshot tools, weren’t succesful either, mostly because the OUYA tends to actually shut down an app when you boot another. That ruled out screensharing and screenshot apps.

Faking screenshots on the simulator isn’t an option either: because of the controller, i can’t play the game in the simulator properly, especially multiplayer. I don’t want to photoshop screenshots either…

How do i solve this? Any ideas are appreciated!

You could always use keyboard input for controlling the game on the simulator.

Lookup “keyevents” in the docs :slight_smile:

Or use display.save instead. Like so:

display.save( display.getCurrentStage(), "fileName.jpg" )

True, but that would still mean i need to get 4 people controlling the simulator with 1 keyboard, while trying to take screenshots at the same time. You can see how this would get complicated fast :slight_smile:

I much rather get the screenshot function working on my ouya, and assign a button that is not in use. That way i can invite some friends, play the game for a bit, and end up with a nice collection of screenshots to choose from. B)

But really, i can’t be the first person to face this problem. How did you other developers sort this?

Yeah, ignore what I said about the keyboard for now…

Did the code I posted above not work for you?

This code works fine on simulator, and definately seems to do something on ouya. The game freezes for about a second, and then continues, as if it was saving the png to someplace. Problem is, i can’t seem to locate the png :huh: 

Ouya’s only (official) file manager does not have a file search function, and i’ve been looking all over the file system for location that had anything to do with my games name or package name, but i came up empty…

The screenshot will be saved to the documents directory.

One solution is to upload the screenshot to your server after it’s saved. Is that an option for you? You can also dump the contents of the documents directory via “adb”, but you will have to google how to do that as I don’t have a link for you.

You’re doing this the hard way.

The Android SDK’s “ddms” tool allows you to take a screenshot of what is currently displayed on an Android device connected to your machine via USB.  Just do the following:

  1. Connect your Ouya device to your machine via USB.
  2. Run the “ddms” tool which can be found under ./AndroidSDK/tools directory.
  3. In the ddms window, left click the Ouya device.
  4. Click on the “Device\Screenshot” menu.

That’s it!

[quote=“Joshua_Quick,post:7,topic:324976”]

You’re doing this the hard way.

The Android SDK’s “ddms” tool allows you to take a screenshot of what is currently displayed on an Android device connected to your machine via USB. Just do the following:

  • Connect your Ouya device to your machine via USB.
  • Run the “ddms” tool which can be found under ./AndroidSDK/tools directory.
  • In the ddms window, left click the Ouya device.
  • Click on the “Device\Screenshot” menu.
    That’s it! [/quote]
    What he said :wink:
    I forgot about this feature in ddms.

DDMS didn’t really work for me - it consistently crashed after 1 succesful screenshot, each time requiring me to reconnect to my ouya to take a new one.

Since this might be useful for other people, i’ll explain how i ended up solving this. Even though i never needed the android SDK during development (just Corona SDK and a dropbox app on the ouya was enough), i ended up needing the SDK for the screenshots after all

So this is how i solved it:

  • i installed the SDK

  • i connected my Ouya using a micro-USB cable and turned ADB over Network on on the console

  • i installed the OUYA drivers on my pc (manual can be found on the ouya site as a youtube clip)

  • when the pc and the ouya were connected over ADB, i made a batch file containing this code:

    rem OUYA_ScreenSot.bat adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 …

  • copy the three recurring lines in this code about 100 times to make a large file

  • I started the game using the controller on the ouya, and doubleclicked the bat file

  • i played the game with a few friends for about 3 minutes

The bat file will take a screenshot on the ouya, and download it to the pc, and repeat this every 2 seconds. The screenshot will be stored as a png with a random file name, located in the folder where the bat file is. You will end up with about 100 screenshots to choose from. Repeat if needed.

The Ouya will behave laggy during this procedure. If it gets really bad, you might want to increase the interval to more than 2 seconds.

Now to find out how to record video…

[quote=“thomasvg50,post:9,topic:324976”]

DDMS didn’t really work for me - it consistently crashed after 1 succesful screenshot, each time requiring me to reconnect to my ouya to take a new one.

Since this might be useful for other people, i’ll explain how i ended up solving this. Even though i never needed the android SDK during development (just Corona SDK and a dropbox app on the ouya was enough), i ended up needing the SDK for the screenshots after all

So this is how i solved it:

  • i installed the SDK

  • i connected my Ouya using a micro-USB cable and turned ADB over Network on on the console

  • i installed the OUYA drivers on my pc (manual can be found on the ouya site as a youtube clip)

  • when the pc and the ouya were connected over ADB, i made a batch file containing this code:

    rem OUYA_ScreenSot.bat adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 …

  • copy the three recurring lines in this code about 100 times to make a large file

  • I started the game using the controller on the ouya, and doubleclicked the bat file

  • i played the game with a few friends for about 3 minutes

The bat file will take a screenshot on the ouya, and download it to the pc, and repeat this every 2 seconds. The screenshot will be stored as a png with a random file name, located in the folder where the bat file is. You will end up with about 100 screenshots to choose from. Repeat if needed.

The Ouya will behave laggy during this procedure. If it gets really bad, you might want to increase the interval to more than 2 seconds.

Now to find out how to record video…[/quote]

Jeez, thats a lot of work. I’m surprised that ddms crashed after taking a screenshot. I have never seen that happen.

DDMS has a new version called “monitor” with the latest Android SDK tools.  It might behave better than DDMS and it can capture screen shots.

Rob

Interesting, thanks for the info.

Thats what you get for not having time to keep up to date with developer related tech (ish) news :slight_smile:

Will check this new tool out tomorrow.

You could always use keyboard input for controlling the game on the simulator.

Lookup “keyevents” in the docs :slight_smile:

Or use display.save instead. Like so:

display.save( display.getCurrentStage(), "fileName.jpg" )

True, but that would still mean i need to get 4 people controlling the simulator with 1 keyboard, while trying to take screenshots at the same time. You can see how this would get complicated fast :slight_smile:

I much rather get the screenshot function working on my ouya, and assign a button that is not in use. That way i can invite some friends, play the game for a bit, and end up with a nice collection of screenshots to choose from. B)

But really, i can’t be the first person to face this problem. How did you other developers sort this?

Yeah, ignore what I said about the keyboard for now…

Did the code I posted above not work for you?

This code works fine on simulator, and definately seems to do something on ouya. The game freezes for about a second, and then continues, as if it was saving the png to someplace. Problem is, i can’t seem to locate the png :huh: 

Ouya’s only (official) file manager does not have a file search function, and i’ve been looking all over the file system for location that had anything to do with my games name or package name, but i came up empty…

The screenshot will be saved to the documents directory.

One solution is to upload the screenshot to your server after it’s saved. Is that an option for you? You can also dump the contents of the documents directory via “adb”, but you will have to google how to do that as I don’t have a link for you.

You’re doing this the hard way.

The Android SDK’s “ddms” tool allows you to take a screenshot of what is currently displayed on an Android device connected to your machine via USB.  Just do the following:

  1. Connect your Ouya device to your machine via USB.
  2. Run the “ddms” tool which can be found under ./AndroidSDK/tools directory.
  3. In the ddms window, left click the Ouya device.
  4. Click on the “Device\Screenshot” menu.

That’s it!

[quote=“Joshua_Quick,post:18,topic:324976”]

You’re doing this the hard way.

The Android SDK’s “ddms” tool allows you to take a screenshot of what is currently displayed on an Android device connected to your machine via USB. Just do the following:

  • Connect your Ouya device to your machine via USB.
  • Run the “ddms” tool which can be found under ./AndroidSDK/tools directory.
  • In the ddms window, left click the Ouya device.
  • Click on the “Device\Screenshot” menu.
    That’s it! [/quote]
    What he said :wink:
    I forgot about this feature in ddms.

DDMS didn’t really work for me - it consistently crashed after 1 succesful screenshot, each time requiring me to reconnect to my ouya to take a new one.

Since this might be useful for other people, i’ll explain how i ended up solving this. Even though i never needed the android SDK during development (just Corona SDK and a dropbox app on the ouya was enough), i ended up needing the SDK for the screenshots after all

So this is how i solved it:

  • i installed the SDK

  • i connected my Ouya using a micro-USB cable and turned ADB over Network on on the console

  • i installed the OUYA drivers on my pc (manual can be found on the ouya site as a youtube clip)

  • when the pc and the ouya were connected over ADB, i made a batch file containing this code:

    rem OUYA_ScreenSot.bat adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 adb shell /system/bin/screencap -p /sdcard/img.png adb pull /sdcard/img.png ouya-%RANDOM%.png timeout /t 2 …

  • copy the three recurring lines in this code about 100 times to make a large file

  • I started the game using the controller on the ouya, and doubleclicked the bat file

  • i played the game with a few friends for about 3 minutes

The bat file will take a screenshot on the ouya, and download it to the pc, and repeat this every 2 seconds. The screenshot will be stored as a png with a random file name, located in the folder where the bat file is. You will end up with about 100 screenshots to choose from. Repeat if needed.

The Ouya will behave laggy during this procedure. If it gets really bad, you might want to increase the interval to more than 2 seconds.

Now to find out how to record video…