Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9177215
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:16:24+00:00 2026-06-17T17:16:24+00:00

If I develop in Eclipse I often press on the green run Button. A

  • 0

If I develop in Eclipse I often press on the green run Button. A popup named Android Device Chooser appears and lets me choose from a list of my connected devices. There is no problem with that in general, as any phone is showing up. I just observed that the Serial Number column is showing two different things:

Normally it shows just the Serial Number, but sometimes the device-name i.e Asus Nexus 7 is showing up. This is extremly helpful, especially if you have more than one device to test on, and you can’t (or won’t) remember all these serials (even more confusing if you have more than one Device with the famous serial 0x0123456789ABCDEF).

I don’t know why and when eclipse shows the device-names, but I’d like to find a way to kind of force eclipse to gather these device-names instead of their serials and show them in the device-chooser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T17:16:25+00:00Added an answer on June 17, 2026 at 5:16 pm

    Check out the source com.android.ddmlib.Device to see how DDMS generate the deivce name/serial number:

    private static final String DEVICE_MODEL_PROPERTY = "ro.product.model"; //$NON-NLS-1$
    private static final String DEVICE_MANUFACTURER_PROPERTY = "ro.product.manufacturer"; //$NON-NLS-1$
    
    ... ...
    
    private static final char SEPARATOR = '-';
    
    ... ...
    
    @Override
    public String getName() {
        if (mName == null) {
            mName = constructName();
        }
    
        return mName;
    }
    
    private String constructName() {
        if (isEmulator()) {
            String avdName = getAvdName();
            if (avdName != null) {
                return String.format("%s [%s]", avdName, getSerialNumber());
            } else {
                return getSerialNumber();
            }
        } else {
            String manufacturer = cleanupStringForDisplay(
                    getProperty(DEVICE_MANUFACTURER_PROPERTY));
            String model = cleanupStringForDisplay(
                    getProperty(DEVICE_MODEL_PROPERTY));
    
            StringBuilder sb = new StringBuilder(20);
    
            if (manufacturer != null) {
                sb.append(manufacturer);
                sb.append(SEPARATOR);
            }
    
            if (model != null) {
                sb.append(model);
                sb.append(SEPARATOR);
            }
    
            sb.append(getSerialNumber());
            return sb.toString();
        }
    }
    
    private String cleanupStringForDisplay(String s) {
        if (s == null) {
            return null;
        }
    
        StringBuilder sb = new StringBuilder(s.length());
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
    
            if (Character.isLetterOrDigit(c)) {
                sb.append(Character.toLowerCase(c));
            } else {
                sb.append('_');
            }
        }
    
        return sb.toString();
    }
    

    If you want to see how DDMS render this device name/serial number, see com.android.ddmuilib.DevicePanel.

    The ro.product.manufacturer and ro.product.model are in /system/build.prop, you can use adb -e shell getprop|grep "\[ro.product" to see the current value:

    [ro.product.manufacturer]: [samsung]
    [ro.product.model]: [GT-I9100]
    

    Then the device name/serial number shown in DDMS perspective is samsung-gt_i9100-0x0123456789ABCDEF. Note that some kludge vendors doesn’t set these two properties properly, that is why for those devices, it only shows the serial number.

    There is no configuration in Eclipse that can let you simply tick and force it shown. If your device is rooted, you can edit these properties so that the device’s manufacturer and model are shown properly in DDMS perspective, for example, using adb shell setprop <key> <value> or directly editing build.prop in file system.


    DDMS in Depth

    The way DDMS used to retrieve device info is quite complicated, in general, when AndroidDebugBridge is up and running, it starts a DeviceMonitor in a separate thread, which keep listening income device connection and issue an remote shell command getprop to the specific device to query device info like ro.product.manufacturer and ro.product.model, this remote shell command execution is unreliable (which may be affected by several factors), and it does not guarantee to grab the properties all the time. See com.android.ddmlib.DeviceMonitor:

    /**
     * Queries a device for its build info.
     * @param device the device to query.
     */
    private void queryNewDeviceForInfo(Device device) {
        // TODO: do this in a separate thread.
        try {
            // first get the list of properties.
            device.executeShellCommand(GetPropReceiver.GETPROP_COMMAND,
                    new GetPropReceiver(device));
    
            queryNewDeviceForMountingPoint(device, IDevice.MNT_EXTERNAL_STORAGE);
            queryNewDeviceForMountingPoint(device, IDevice.MNT_DATA);
            queryNewDeviceForMountingPoint(device, IDevice.MNT_ROOT);
    
            // now get the emulator Virtual Device name (if applicable).
            if (device.isEmulator()) {
                EmulatorConsole console = EmulatorConsole.getConsole(device);
                if (console != null) {
                    device.setAvdName(console.getAvdName());
                }
            }
        } catch (TimeoutException e) {
            Log.w("DeviceMonitor", String.format("Connection timeout getting info for device %s",
                    device.getSerialNumber()));
    
        } catch (AdbCommandRejectedException e) {
            // This should never happen as we only do this once the device is online.
            Log.w("DeviceMonitor", String.format(
                    "Adb rejected command to get  device %1$s info: %2$s",
                    device.getSerialNumber(), e.getMessage()));
    
        } catch (ShellCommandUnresponsiveException e) {
            Log.w("DeviceMonitor", String.format(
                    "Adb shell command took too long returning info for device %s",
                    device.getSerialNumber()));
    
        } catch (IOException e) {
            Log.w("DeviceMonitor", String.format(
                    "IO Error getting info for device %s",
                    device.getSerialNumber()));
        }
    }
    

    Notice all exceptions device.executeShellCommand() thrown and handled by DeviceMonitor.queryNewDeviceForInfo(), If any of these occurred, DDMS will not get the properties properly.

    If you want to read the full source, check out here.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working with a team using Eclipse to develop for android. We often
I develop one app for android, on eclipse. It works in the emulator, very
Background: I am using Eclipse to develop an Android app. I have an xml
I am using Eclipse to develop an Android application that plots Bluetooth data. I
I'm using Eclipse to develop an Android app to plot Bluetooth data. The primary
I'm using Eclipse to develop Android application, now I want to use Bluestack as
I'm using Eclipse to develop Android apps. I'm using the latest SDK and Eclipse
I am using Eclipse to develop Android apps. I am importing one example to
I use Eclipse to develop in java for Android. I have installed Mercurial to
I want to install eclipse to develop in Java, Python, Android platform. What is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.