def pull(remotefile, localfile)
      if localfile.end_with?('/') || File.directory?(localfile)
        localdir = localfile.chomp('/')
        localfilename = nil
      else
        localdir = File.dirname(localfile)
        localfilename = File.basename(localfile)
      end
      unless File.exist?(localdir)
        FileUtils.mkdir_p(localdir)
      end
      
      localfilename = File.basename(remotefile) if localfilename.nil?
      @device.pullFile(remotefile, "#{localdir}/#{localfilename}")
      self
    end
def pull(remotefile, localfile)
      if localfile.end_with?('/') || File.directory?(localfile)
        localdir = localfile.chomp('/')
        localfilename = nil
      else
        localdir = File.dirname(localfile)
        localfilename = File.basename(localfile)
      end
      unless File.exist?(localdir)
        FileUtils.mkdir_p(localdir)
      end
      
      localfilename = File.basename(remotefile) if localfilename.nil?
      @device.pullFile(remotefile, "#{localdir}/#{localfilename}")
      self
    end
Pulls a file from the device.

 If *localfile* path ends with '/', complements by the basename of
 *remotefile*.
 @example
   device = AdbSdkLib::Adb.new.devices.first
   device.pull('/data/local/tmp/remote.txt', 'path/to/local.txt')
   device.pull('/data/local/tmp/file.txt', 'path/to/dir/') # uses file.txt
 @param [String] remotefile the name of the remote file on the device to get
 @param [String] localfile the name of the local file or directory
 @return [self] self