Using "adb install" with your OUYA

After setting up my OUYA I noticed that connecting a micro-USB cable from my desktop to it didn’t allow me to use the “adb” command to manage my apps.

The Android File Transfer app popped up every time, and I could drag-and-drop files to the OUYA, so I knew that the connection was working.
 
After some digging around I found the problem, and this tutorial will explain what needs to be done.
This is for anyone who’d like to use “adb” to manage their Corona apps on the OUYA.
 
Prerequisits:
• Correctly installed and functioning “adb” utility as found in the Android SDK.
(I’m on a Mac but I assume the following should also work on Windows)
 
 
Setting up a tethered connection with a micro-USB cable
 

  1. Unplug the micro-USB cable from your OUYA.
     

  2. You need to add the Vendor ID of your OUYA to the  ~/.android/adb_usb.ini  file.
    Edit the file (create it if it doesn’t exist), and add the following on one line:

    0x2836

 
3. Run:

adb kill-server

 to terminate any existing deamons.
 
 
4. Connect the micro-USB cable to your OUYA, and run:

adb devices

You should now be able to see your OUYA listed!
 
After this, you can run any adb command like “adb install” or “adb remove”.

NOTE: Before installing one of your Corona apps remember to compile it for OUYA in the build dialog.
After installation you’ll find it under “MAKE -> SOFTWARE” on your OUYA.
 
 
ADB over WiFi
 
After you’ve got the wired connection working and if you’re still feeling adventurous, you can take it one step further and enable adb over WiFi!
 
DISCLAIMER:

This can be potentially dangerous if you don’t follow all the steps properly (OUYA may not boot).

DO NOT DO THIS UNLESS YOU KNOW WHAT YOU’RE DOING!

However if you’re comfortable with living on the edge, proceed with caution.
 
Prerequisits :
• Functional USB connection (as decribed above)
• Functional WiFi connection to your OUYA. (You’ll need to know your OUYA’s WiFi IP address)
 

  1. Boot up your OUYA and connect it with a micro-USB cable.

  2. Open a terminal and run the following commands:

    adb shell su mount -o rw,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP chmod 666 /system/build.prop

  3. Open a second terminal and run the following command:

    adb pull /system/build.prop

  4. Open build.prop in your favorite text editor and add this line at the end of the file:

    service.adb.tcp.port=5555

  5. Save the file, exit the text editor and run the following command:

    adb push build.prop /system

  6. Now go back to your *first* terminal shell for the OUYA and run the following IMPORTANT commands:

    chmod 644 /system/build.prop

and the command:

mount -o ro,remount -t ext4 /dev/block/platform/sdhci-tegra.3/by-name/APP
  1.  Done!

    exit

  2. Shut down your OUYA, disconnect both the power and USB cables. Put your OUYA where you want it, connect power and boot it up.
     

To wirelessly connect to your OUYA, use the following command:

adb connect xxx.xxx.xxx.xxx

(xxx.xxx.xxx.xxx is your OUYA’s WiFi IP address)

After it’s connected you’ll be able to issue any “adb” command you like.

Disconnect from your OUYA with:

adb disconnect