Sha256: 59b7f4f011fa1e766d609a9521bd61aa6de63bb6f9ac7323ab06ff329b0ba1db

Contents?: true

Size: 1.1 KB

Versions: 5

Compression:

Stored size: 1.1 KB

Contents

#!/usr/bin/env ruby

require "appium_instrumenter"


def print_usage
  puts "appium_instrumenter instrument <app_under_test_path>"
  puts "OR"
  puts "appium_instrumenter resign <apk-path>"
end

def is_apk_file?(file_path)
  file_path.end_with? ".apk" and File.exist? file_path
end

def relative_to_full_path(file_path)
  File.expand_path(file_path)
end

if ARGV.length == 0
  print_usage
else
  cmd = ARGV.shift
  case cmd
    when 'instrument'
      app_under_test = ARGV[0]
      if !File.exist?(app_under_test)
        puts "Could not find file '#{app_under_test}'"
        exit 1
      elsif !is_apk_file?(app_under_test)
        puts "'#{app_under_test}' is not a valid android application"
        exit 1
      else
        app_under_test_path = relative_to_full_path(app_under_test)
        AppiumInstrumenter.instrument(app_under_test_path)
      end

    when 'resign'
      app_to_resign = ARGV[0]
      fail("Please specify app to sign") unless ARGV[0]
      AppiumInstrumenter.unsign_and_resign_apk(relative_to_full_path(app_to_resign))
    else
      puts "Invalid command '#{cmd}'"
      print_usage
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
appium_instrumenter-0.1.6 exe/appium_instrumenter
appium_instrumenter-0.1.5 exe/appium_instrumenter
appium_instrumenter-0.1.4 exe/appium_instrumenter
appium_instrumenter-0.1.3 exe/appium_instrumenter
appium_instrumenter-0.1.2 exe/appium_instrumenter