Social Icons

Work-Arounds & Solutions for Connecting Phones to the Blocks Editor


This page may provide some help on troubleshooting connection problems between the phone and Blocks editor. There are several different causes for these. We're attempting to sort through the various symptoms, causes, and solutions. Thanks for your patience and assistance while we're doing this.

Work-Arounds & Solutions

Here are a few of the issues we know about, with work-arounds. Most of these are identified by looking at the Java console and what happens on the phone and in the blocks editor. You can find instructions for how to view the Java console at bottom of the documentation on testing.

Issue : After clicking Connect To Phone in the Blocks Editor, the white Screen1 on the phone flashes and disappears, or you never see it at all and the Blocks Editor tells you to plug in the phone. The Java console has a message saying "Failed in setupSocket".

Cause: The most likely cause of this is that your phone is running Android 1.5. (If not and these are your exact symptoms, please let us know).

Workaround: Android 1.5 is not currently working with App Inventor in connected phone. We're happy to report that we have a fix for this! Your Android 1.5 phones will work in connected mode the next time we update our App Inventor servers (probably in a week or two). In the meantime, we recommend using the emulator (make sure it is version 1.6 or higher) for connected development, and then downloading your packaged apps to your phone.

Issue: Your phone is running version 1.6 or newer. After clicking Connect To Phone in the Blocks Editor, the white Screen1 appears eventually, but the Blocks Editor tells you to plug in the phone and the Java console has a message saying "Failed in setupSocket". This might happen every time you try to connect, or just some of the time.

Cause: It looks like there is a timing issue where the app that runs on the phone to connect to the blocks editor doesn't start up quickly enough and the blocks editor gives up and assumes it cannot make the connection.

Workaround: You can try stopping other apps on your phone that might be slowing it down (e.g., sync services, Twitter, etc.) and then try connecting to the blocks editor. If this works for you then you probably are experiencing the timing problem mentioned above. We believe we have a fix for this that will be available the next time we update the App Inventor servers (in a week or two).

Issue: The Java console prints the message "adb-forward: Device rejected command: cannot bind socket" and the blocks editor fails to connect to the phone.

Cause: Most likely, some other application on your computer is using port 9997.

Workaround: You can usually use a command on your computer to find out which applications might have the port open.

For Linux and perhaps Mac open a shell (Terminal) window and type
lsof | grep 9997
to see the name and process id of the application that has port 9997 open.

On Windows, use the command
netstat -ao |find /i "9997"
At the end of the line is the process id (PID). Use the command
tasklist |find /i "PID"

If you stop the application that was using port 9997 then the blocks editor should be able successfully run the "adb forward" command and, hopefully, connect to your phone (assuming you don't also have one of the other problems mentioned above).

In the future we may allow the blocks editor to use ports other than 9997 to connect to the phone, but it will probably not be possible in the next server update.

Issue: When you try to Connect to Phone the blocks editor tells you to plug in a phone. The Java console contains the line: Device connected: ????????????

Cause: Your phone is not being recognized by the ADB (Android Debug Bridge). This could be an issue with drivers or permissions.

Workaround: The solution varies depending on the type of system you are on and the type of phone you have. Search the App Inventor Forum and other Android forums on the web to find advice for your particular system and phone. Many people have posted fixes with pointers to drivers or instructions. You will know that you have solved this particular problem when the command "adb devices" shows you a device id that is a combination of letters and numbers. See the documentation under "Testing and Debugging" for information on how to run the adb program.

Issue: You can connect to the phone but you are not seeing any of your media on the phone (images, sounds). The Java console might have a message like "ddms: transfer error: Permission denied" and "yacodeblocks.AndroidControllerException: Failed to upload file". Or the Blocks Editor might give an error "Can't play the file meow.wav."

Cause: The phone's USB connection mode is set to the wrong option.

Workaround: Pull down the screen notification panel (where the USB icon should be showing), and press the "USB connected" button. The options shown will depend on the phone model:
On the Nexus One, you'll see a button to "Turn on USB Storage", don't select it.
On the Droid, you'll see four different options. Select the option for "Windows Media Sync".