Package com.android.ddmlib

Examples of com.android.ddmlib.IDevice


    protected void finished() {
        logger.trace("finished");
    }

    private ImageEx fetchScreen() {
        final IDevice d = device;
        final boolean landscape = mediator.isLandscape();
        final boolean ccw = p.getBoolean(PREF_ROTATION_CCW, true);
        ImageEx image = null;
        if (d != null) {
            try {
View Full Code Here


    @Override
    protected Void doInBackground() throws Exception {
        AndroidDebugBridge bridge = AndroidDebugBridge.getBridge();
        IDevice[] devices = bridge.getDevices();
        IDevice selectedDevice = null;
        String connectedDevice = mediator.getConnectedDevice();

        final String absolutePath = file.getAbsolutePath();
        final String fileName = file.getName();
        mediator.setStatus("status.install.file", fileName);
        if (file.exists() && file.isFile() && file.canRead()) {

            for (IDevice iDevice : devices) {
                if (StringUtils.equals(iDevice.toString(), connectedDevice)) {
                    selectedDevice = iDevice;
                    break;
                }
            }

            if (selectedDevice != null) {
                selectedDevice.installPackage(absolutePath, true);
            } else {
                logger.error("Cannot find device: {}", connectedDevice);
                mediator.setStatus("status.error.install.device", connectedDevice);
            }
            mediator.setStatus("status.install");
View Full Code Here

    protected void finished() {
        logger.trace("finished");
    }

    private ImageEx fetchScreen() {
        final IDevice d = device;
        final boolean landscape = mediator.isLandscape();
        final boolean ccw = p.getBoolean(PREF_ROTATION_CCW, true);
        ImageEx image = null;
        if (d != null) {
            try {
View Full Code Here

    protected void finished() {
        logger.trace("finished");
    }

    private ImageEx fetchScreen() {
        final IDevice d = device;
        final boolean landscape = mediator.isLandscape();
        final boolean ccw = p.getBoolean(PREF_ROTATION_CCW, true);
        ImageEx image = null;
        if (d != null) {
            try {
View Full Code Here

  public static void uninstallApk(IDevice device){}
  public static void installAPK()
      throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException{
    DdmsDeviceSelectDialog dialog = new DdmsDeviceSelectDialog(MainFrame.getInstance())
    dialog.setVisible(true);
    IDevice device = dialog.getSelectedDevice();
    if(device == null)return;
    JFileChooser chooser = new JFileChooser();
    int result = chooser.showOpenDialog(MainFrame.getInstance());
    if(result == JFileChooser.CANCEL_OPTION) return;
    DeviceUtils.installAPK(device, chooser.getSelectedFile().getAbsolutePath(), true);
View Full Code Here

  }
  public static void installAPKAAPT()
      throws TimeoutException, AdbCommandRejectedException, ShellCommandUnresponsiveException, IOException{
    DdmsDeviceSelectDialog dialog = new DdmsDeviceSelectDialog(MainFrame.getInstance())
    dialog.setVisible(true);
    IDevice device = dialog.getSelectedDevice();
    if(device == null)return;
    JFileChooser chooser = new JFileChooser();
    int result = chooser.showOpenDialog(MainFrame.getInstance());
    if(result == JFileChooser.CANCEL_OPTION) return;
    DeviceUtils.installAPK(device, chooser.getSelectedFile().getAbsolutePath(), true);
View Full Code Here

      private static final long serialVersionUID = 1L;
      @Override
      public void actionPerformed(ActionEvent e) {
        DdmsDeviceSelectDialog dialog = new DdmsDeviceSelectDialog(parent);
        dialog.setVisible(true);
        IDevice device = dialog.getSelectedDevice();
        if(device == null) return ;
        if(StringUtils.isEmpty(device.getSerialNumber())){
          UIHelper.showErrorDialog(getInstance(), "Unkonw Device SerialNumber");
          return;
        }       
        try{
          String title  = DeviceHelper.getDeviceDescName(device);
          Process process = AdbManager.execCommand(new Command(new String[]{"-s",device.getSerialNumber(),"shell"}), terminalPanel);
          terminalPanel.dispose();
          terminalPanel.setProcess(process, title);
          appendTitle(title);
        }catch(Exception ex){
          UIHelper.showErrorDialog(getInstance(), ex.getMessage());
View Full Code Here

      private static final long serialVersionUID = 1L;
      @Override
      public void actionPerformed(ActionEvent e) {
        DdmsDeviceSelectDialog dialog = new DdmsDeviceSelectDialog(getInstance())
        dialog.setVisible(true);
        IDevice device = dialog.getSelectedDevice();
        if(device == null)return;
        addTabCard(device);
      }
    });
    JMenuItem apkViewItem = new JMenuItem("Apk View");
View Full Code Here

      private static final long serialVersionUID = 1L;
      @Override
      public void actionPerformed(ActionEvent e) {
        DdmsDeviceSelectDialog dialog = new DdmsDeviceSelectDialog(mainFrame)
        dialog.setVisible(true);
        IDevice device = dialog.getSelectedDevice();
        if(device == null)return;
        mainFrame.addTabCard(device);
      }
    });
   
View Full Code Here

TOP

Related Classes of com.android.ddmlib.IDevice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.