Android ScreenCast

View and interact with your Android Phone on your PC!

I stumbled across this nifty utility:

Android ScreenCast

It allows you to view and record your screen and explore your Android device on your computer. Rooted devices can also accept input controls (keyboard and mouse). The tool is java based so is cross platform.

 

Installation

The instructions on the link above are very simple and should be sufficient for a basic installation. Try that first. If you have any trouble, this guide will go into more detail and provide alternative methods of getting you up and running. Since my main OS is Windows, this guide will focus on the Windows based components of the SDK but very similar methods apply if you are running Linux or OSX.

– Download and install the latest Java Runtime Environment here
– Download the Android SDK here: here
– Run the SDK by launching SDK Setup.exe and install the latest version of “Android Platform Tools” via the updater.

If you are unable to download the components via the SDK interface (for example, if you are behind a proxy that requires authentication), then you can download the latest version via your browser using the following method.

Standalone SDK Component Download

You only need to do this if the updater in the SDK does not work.

View this XML file http://dl-ssl.google.com/android/repository/repository.xml containing the latest SDK file names. Locate the Android Platform Tools for your OS.

<sdk:archive os=”windows” arch=”any”>
<sdk:size>10075800</sdk:size>
<sdk:checksum type=”sha1″>ee7f70ed0c15286d6dbca85b57eb3d1950cc8ec4</sdk:checksum>
<sdk:url>platform-tools_r04-windows.zip</sdk:url>
</sdk:archive>

The archive file name is the information we are after; platform-tools_r04-windows.zip

The address to put in your browser is therefore

http://dl-ssl.google.com/android/repository/platform-tools_r04-windows.zip

The file should be downloaded, unpacked and the root folder placed in the platforms directory within the SDK to give a path similar to

android-sdk-windows\platforms\platform-tools_r04-windows

 

Connecting to your phone

Connect your phone by USB and make sure USB debugging is enabled.
Settings->Applications->Development->USB Debugging (Debug mode when USB is connected)

Check that it is detected as an ADB device. If you are unsure about this, you can check whether it is connected correctly using the command

adb devices

adb.exe can be found in the Platform Tools directory or the Tools directory of the SDK. If your phone is connected correctly, the command will return it’s specific ID will be displayed as a connected device.

In this case the device ID is 0123456789ABCDEF

You can now launch androidscreencast.jnlp which should successfully connect to your phone.

 

Running in Offline Mode

Since this is essentially a web based java application launcher, every time you run it, it connects to a webserver to download the appropriate (and latest) java runtime files. There are instances where this may be undesirable and this section explains how to run AndroidScreenCast in “Offline Mode”

Files required

androidscreencast.jnlp download
androidscreencast.jar download
ddmlib.jar download (note that this .jar file is different to the file of the same name found in the Platform Tools directory)

You must have the Android SDK and Platform Tools installed as described previously.

Place all three files in the same directory (in this guide I will use the directory C:\AndroidScreenCast)

Since all the application files are now local, the launcher (.jnlp file) needs to be edited to reference the local copies rather than the web based ones.

Codebase

Original

<jnlp spec=”0.2 1.0″
codebase=”http://androidscreencast.googlecode.com/svn/trunk/AndroidScreencast/dist/” href=”androidscreencast.jnlp”>

Modified

<jnlp spec=”0.2 1.0″
codebase=”file://localhost/C:/AndroidScreenCast/” href=”androidscreencast.jnlp”>

Resources

Original

<resources>
<j2se version=”1.5+” href=”http://java.sun.com/products/autodl/j2se”/>
<j2se version=”1.5+”/>
<jar href=”androidscreencast.jar” main=”true” download=”eager”/>
<jar href=”ddmlib.jar” main=”false” download=”eager”/>
</resources>

Modified

<resources>
<jar href=”androidscreencast.jar” main=”true” />
<jar href=”ddmlib.jar” main=”false” />
</resources>

Save the changes, ensure your device is connected and run the androidscreencast.jnlp

The application will now run without downloading the runtime files every time. The main disadvantage to doing this is that if there are any updates, you need to change the files manually. Otherwise, functionality is identical.

Any comments/questions/problems, post below

Have fun!

 

 

Note:

To stop the screen turning off when in use, enable the following

Settings->Applications->Development->Stay Awake (Screen will never sleep while charging)

Share

27 Responses

  1. Hi..

    I have successfully installed as needed and able to connect my laptop [windows 7] to the Samsung Galaxy5 [GTI5500] cell phone which runs CyannogenMod 7 ROM.

    I’m able to use my keyboard & mouse of the laptop and I can see the phone accepts those inputs and work accordingly.

    However, I’m not able to get the screen correctly displayed on my laptop. I see only a set of horizontal colorful lines on the Laptop screen for the Phone window.

    Could some one help me to get the display right ? thanks in advance.

    Kv Rajan.

  2. Hi,

    It may be a further setting in CM7 or a bug for that port/build as it currently stands. I can’t confirm that myself though as I don’t have that phone.

    May be worth trying another ROM and seeing if the problem is still there.

    HTH

  3. Thanks for posting these – very helpful. I’ve modified the code to allow offline devices, but I’m still getting “request rejected – device offline”. This is the code at the moment:

    Android Screencast
    Alexandre Thiel

    Control an android device remotely !
    Control an android device remotely

    Anything else I can try?

    (I can’t ut my phone online – trying to do this because the screen is ****ed.)

    • I’m not sure what code you have modified? There doesn’t seem to be anything in your post!

      The “Offline Mode” I mention is referring to the connecting computer being offline rather than to the phone itself.

      The issue you are having connecting sounds as if it can’t connect to the phone adb – if the screen is damaged have you been able to enable USB debug mode as described in the first steps in the guide?

      • I am having the same problem,

        java.lang.RuntimeException: java.lang.RuntimeException: java.io.IOException: device (0216ee804c0ac5d4) request rejected: device offline

        my debugging setting are on as described and screencast can see the device (‘adb.exe devices’ displays my device and the number is displayed at the top of screencast)

        • I got the exact same thing. Adb works, device is recognised and i’n on my homescreen. Though when i start screencast it gives an java error with device offline.. Any help?

          • This seems to be an issue since the Android update to 4.4.2+ where every PC/device connecting via adb needs to be authorized.

            Make sure you have the latest version of adb (i.e. latest platform tools) and run adb from the correct folder/working directory.

            You can check the version by running ‘adb version’ – should be 1.0.31 at time of writing.

            ‘adb devices’ should now report ‘unauthorized’ rather than offline and if you unplug/reconnect your device, you should get a popup on it asking for authorisation.

        • This seems to be an issue since the Android update to 4.4.2+ where every PC/device connecting via adb needs to be authorized.

          Make sure you have the latest version of adb (i.e. latest platform tools) and run adb from the correct folder/working directory.

          You can check the version by running ‘adb version’ – should be 1.0.31 at time of writing.

          ‘adb devices’ should now report ‘unauthorized’ rather than offline and if you unplug/reconnect your device, you should get a popup on it asking for authorisation.

    • This seems to be an issue since the Android update to 4.4.2+ where every PC/device connecting via adb needs to be authorized.

      Make sure you have the latest version of adb (i.e. latest platform tools) and run adb from the correct folder/working directory.

      You can check the version by running ‘adb version’ – should be 1.0.31 at time of writing.

      ‘adb devices’ should now report ‘unauthorized’ rather than offline and if you unplug/reconnect your device, you should get a popup on it asking for authorisation.

  4. Thanks.
    It works properly in my side.
    Besides,
    I am trying to build androidscreencast by myself.
    I can build successfully after modify sdk-ddmlib to ddmlib in build.xml
    But it launch failed due to below exception

    ava.lang.NullPointerException
    at javax.swing.ImageIcon.

    I found your JAR file working properly.
    Do you meet this problem?

  5. Your post really helped.

    For those who get some error message which goes like

    (||| ]at
    com.sun.javaws.jnl.xml.XMLFormat.parse(Unknown Source)at
    com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)at
    com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)at
    com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)at
    com.sun.javaws.Main.main(Unknown Source),

    the quotation mark should be used instead of and
    androidscreencast.jnlp must be saved in UTF-8 encoding. Otherwise,
    XML parser fails to parse the data in androidscreencast.jnlp.

    When using a normal text editor like notepad++, I failed to pay attention to
    the validity of XML, but when I opened it in Visual Studio 2010, it pointed out
    the wrong choice of quotation mark.

    Hope someone who had the same problem may find this tip useful.

    Thank you Leonard!

  6. I followed the instructions above but I still can’t control my Samsung Galaxy 3 from my desktop.

    My devices is rooted.
    I run javaws androidscreencast.jnlp

    I am able to see my device, but I can’t control anything.

    Please help

  7. pls give the tutorial for this too,thanks in advance for these beeyoootiful tweaks.
    i am a noob when it comes to java i tried following the above technique and edit the source code and resource after downloading the jar in the same folder but landed up to the exception -JNLPException[category: Launch File Error : Exception: null : LaunchDesc:

    Android Screencast
    alexfdz

    androidscreencast Honeycomb support

    ]
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResourcesHelper(Unknown Source)
    at com.sun.javaws.security.JNLPSignedResourcesHelper.checkSignedResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareAllResources(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.prepareToLaunch(Unknown Source)
    at com.sun.javaws.Launcher.launch(Unknown Source)
    at com.sun.javaws.Main.launchApp(Unknown Source)
    at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
    at com.sun.javaws.Main.access$000(Unknown Source)
    at com.sun.javaws.Main$1.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)

  8. 1 2

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.