当前位置: 首页>>代码示例>>Java>>正文


Java Client.getDebuggerListenPort方法代码示例

本文整理汇总了Java中com.android.ddmlib.Client.getDebuggerListenPort方法的典型用法代码示例。如果您正苦于以下问题:Java Client.getDebuggerListenPort方法的具体用法?Java Client.getDebuggerListenPort怎么用?Java Client.getDebuggerListenPort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.android.ddmlib.Client的用法示例。


在下文中一共展示了Client.getDebuggerListenPort方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: data

import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public AndroidDebugData data(Client client) {
    final int port = client.getDebuggerListenPort();
    final Map<String, Object> properties = Maps.newHashMap();
    final GradleAndroidClassPathProvider cpp = project.getLookup().lookup(GradleAndroidClassPathProvider.class);
    final ClassPath sourcePath = cpp.getSourcePath();
    final ClassPath compilePath = cpp.getCompilePath();
    final ClassPath bootPath = cpp.getBootPath();
    properties.put("sourcepath",
            ClassPathSupport.createProxyClassPath(sourcePath, Launches.toSourcePath(compilePath)));
    properties.put("name", ProjectUtils.getInformation(project).getDisplayName()); // NOI18N
    properties.put("jdksources", Launches.toSourcePath(bootPath)); // NOI18N
    properties.put("baseDir", FileUtil.toFile(project.getProjectDirectory()));   //NOI18N
    return new AndroidDebugData("localhost", port, properties);
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:16,代码来源:GradleDebugInfo.java

示例2: doLaunchAfterBuild

import com.android.ddmlib.Client; //导入方法依赖的package包/类
public void doLaunchAfterBuild(final String command, AndroidArtifactOutput artifactOutput) {
    if (!Launches.isLaunchingCommand(command)) {
        return;
    }
    // TODO(radim): where to get config
    final LaunchConfiguration launchConfig = launchConfig();
    // project.getLookup().lookup(AndroidConfigProvider.class).getActiveConfiguration().getLaunchConfiguration();

    final AndroidPlatformInfo platform = AndroidProjects.projectPlatform(project);
    final AndroidLauncher launcher = Preconditions.checkNotNull(
            project.getLookup().lookup(AndroidLauncher.class));
    final LaunchInfo launchInfo = createLaunchInfo(artifactOutput, command, launchConfig);
    final LaunchAction launchAction = findLaunchAction(command);
    if (!Launches.isDebugCommand(command)) {
        launcher.launch(platform,
                Lookups.fixed(launchInfo,
                        launchAction,
                        launchConfig,
                        project),
                command);
    } else {
        final Future<Client> future = launcher.launch(platform,
                Lookups.fixed(launchInfo,
                        launchAction,
                        launchConfig,
                        project),
                command);
        if (future != null) {
            Client c = null;
            try {
                c = future.get(20, TimeUnit.SECONDS);
            } catch (InterruptedException interruptedException) {
            } catch (ExecutionException executionException) {
            } catch (TimeoutException timeoutException) {
            }
            if (c != null) {
                final int port = c.getDebuggerListenPort();
                final Map<String, Object> properties = Maps.newHashMap();
                final GradleAndroidClassPathProvider cpp
                        = project.getLookup().lookup(GradleAndroidClassPathProvider.class);
                final ClassPath sourcePath = cpp.getSourcePath();
                final ClassPath compilePath = cpp.getCompilePath();
                final ClassPath bootPath = cpp.getBootPath();
                properties.put("sourcepath",
                        ClassPathSupport.createProxyClassPath(sourcePath, Launches.toSourcePath(compilePath)));
                properties.put("name", ProjectUtils.getInformation(project).getDisplayName()); // NOI18N
                properties.put("jdksources", Launches.toSourcePath(bootPath)); // NOI18N
                properties.put("baseDir", FileUtil.toFile(project.getProjectDirectory()));   //NOI18N
                try {
                    JPDADebugger.attach("localhost", port, new Object[]{properties}); //NOI18N
                } catch (DebuggerStartException ex) {
                    Exceptions.printStackTrace(ex);
                }
            } else {
                NotifyDescriptor nd = new NotifyDescriptor.Message("Unable to get Android Client Info ", NotifyDescriptor.ERROR_MESSAGE);
                DialogDisplayer.getDefault().notifyLater(nd);
            }
        }
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:61,代码来源:GradleLaunchExecutor.java

示例3: getColumnText

import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public String getColumnText(Object element, int columnIndex) {
    if (element instanceof IDevice) {
        IDevice device = (IDevice)element;
        switch (columnIndex) {
            case DEVICE_COL_SERIAL:
                return device.getName();
            case DEVICE_COL_STATE:
                return getStateString(device);
            case DEVICE_COL_BUILD: {
                String version = device.getProperty(IDevice.PROP_BUILD_VERSION);
                if (version != null) {
                    String debuggable = device.getProperty(IDevice.PROP_DEBUGGABLE);
                    if (device.isEmulator()) {
                        String avdName = device.getAvdName();
                        if (avdName == null) {
                            avdName = "?"; // the device is probably not online yet, so
                                           // we don't know its AVD name just yet.
                        }
                        if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
                            return String.format("%1$s [%2$s, debug]", avdName,
                                    version);
                        } else {
                            return String.format("%1$s [%2$s]", avdName, version); //$NON-NLS-1$
                        }
                    } else {
                        if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
                            return String.format("%1$s, debug", version);
                        } else {
                            return String.format("%1$s", version); //$NON-NLS-1$
                        }
                    }
                } else {
                    return "unknown";
                }
            }
        }
    } else if (element instanceof Client) {
        Client client = (Client)element;
        ClientData cd = client.getClientData();

        switch (columnIndex) {
            case CLIENT_COL_NAME:
                String name = cd.getClientDescription();
                if (name != null) {
                    return name;
                }
                return "?";
            case CLIENT_COL_PID:
                return Integer.toString(cd.getPid());
            case CLIENT_COL_PORT:
                if (mAdvancedPortSupport) {
                    int port = client.getDebuggerListenPort();
                    String portString = "?";
                    if (port != 0) {
                        portString = Integer.toString(port);
                    }
                    if (client.isSelectedClient()) {
                        return String.format("%1$s / %2$d", portString, //$NON-NLS-1$
                                DdmPreferences.getSelectedDebugPort());
                    }

                    return portString;
                }
        }
    }
    return null;
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:69,代码来源:DevicePanel.java

示例4: getColumnText

import com.android.ddmlib.Client; //导入方法依赖的package包/类
@Override
public String getColumnText(Object element, int columnIndex) {
    if (element instanceof IDevice) {
        IDevice device = (IDevice)element;
        switch (columnIndex) {
            case DEVICE_COL_SERIAL:
                return getDeviceName(device);
            case DEVICE_COL_STATE:
                return getStateString(device);
            case DEVICE_COL_BUILD: {
                String version = device.getProperty(IDevice.PROP_BUILD_VERSION);
                if (version != null) {
                    String debuggable = device.getProperty(IDevice.PROP_DEBUGGABLE);
                    if (device.isEmulator()) {
                        String avdName = device.getAvdName();
                        if (avdName == null) {
                            avdName = "?"; // the device is probably not online yet, so
                                           // we don't know its AVD name just yet.
                        }
                        if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
                            return String.format("%1$s [%2$s, debug]", avdName,
                                    version);
                        } else {
                            return String.format("%1$s [%2$s]", avdName, version); //$NON-NLS-1$
                        }
                    } else {
                        if (debuggable != null && debuggable.equals("1")) { //$NON-NLS-1$
                            return String.format("%1$s, debug", version);
                        } else {
                            return String.format("%1$s", version); //$NON-NLS-1$
                        }
                    }
                } else {
                    return "unknown";
                }
            }
        }
    } else if (element instanceof Client) {
        Client client = (Client)element;
        ClientData cd = client.getClientData();

        switch (columnIndex) {
            case CLIENT_COL_NAME:
                String name = cd.getClientDescription();
                if (name != null) {
                    return name;
                }
                return "?";
            case CLIENT_COL_PID:
                return Integer.toString(cd.getPid());
            case CLIENT_COL_PORT:
                if (mAdvancedPortSupport) {
                    int port = client.getDebuggerListenPort();
                    String portString = "?";
                    if (port != 0) {
                        portString = Integer.toString(port);
                    }
                    if (client.isSelectedClient()) {
                        return String.format("%1$s / %2$d", portString, //$NON-NLS-1$
                                DdmPreferences.getSelectedDebugPort());
                    }

                    return portString;
                }
        }
    }
    return null;
}
 
开发者ID:lrscp,项目名称:ControlAndroidDeviceFromPC,代码行数:69,代码来源:DevicePanel.java


注:本文中的com.android.ddmlib.Client.getDebuggerListenPort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。