Class: Idb::AbstractDevice

Inherits:
Object
  • Object
show all
Defined in:
lib/lib/abstract_device.rb

Direct Known Subclasses

Device, Simulator

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#apps_dirObject

Returns the value of attribute apps_dir.



3
4
5
# File 'lib/lib/abstract_device.rb', line 3

def apps_dir
  @apps_dir
end

#opsObject

Returns the value of attribute ops.



4
5
6
# File 'lib/lib/abstract_device.rb', line 4

def ops
  @ops
end

Instance Method Details

#closeObject



25
26
27
# File 'lib/lib/abstract_device.rb', line 25

def close

end

#get_app_uuidsObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/lib/abstract_device.rb', line 7

def get_app_uuids
  if not @ops.file_exists? @apps_dir
    puts "Application directory #{@apps_dir} not found."
    raise "Application directory #{@apps_dir} not found."
  end

  puts '[*] Retrieving list of applications...'

  dirs =  @ops.list_dir "#{@apps_dir}"
  dirs.select! { |x| x != "." and x != ".." }

  if dirs.length == 0
    puts "No applications found in #{@apps_dir}."
    raise "No applications found in #{@apps_dir}."
  end
  return dirs
end