ADB 0.5.2 → 0.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog CHANGED
@@ -1,3 +1,9 @@
1
+ === Release 0.5.3 / 2012-9-18
2
+ * Enhancements
3
+ * Added travis-ci config file for automated specs
4
+ * Fixes
5
+ * Corrected push, pull when path has space
6
+
1
7
  === Release 0.5.2 / 2012-9-18
2
8
  * Fixes
3
9
  * Corrected install when path has space
@@ -72,10 +72,11 @@ Then /^I can attain root privileges$/ do
72
72
  end
73
73
 
74
74
  Then /^I should be able to push a file to the local device$/ do
75
- # confirm that the file doesn't already exist
75
+ # be sure that the file doesn't already exist
76
76
  sn = devices[0]
77
77
  wait_for_device({:serial => sn}, 60)
78
78
  remount({:serial => sn})
79
+ shell('rm /system/cuke_test_file.txt', {:serial => sn})
79
80
  shell('ls /system/cuke_test_file.txt', {:serial => sn})
80
81
  last_stdout.should include 'No such file or directory'
81
82
 
@@ -0,0 +1,37 @@
1
+ language: java
2
+ before_install:
3
+ # download the latest android sdk and unzip
4
+ - wget http://dl.google.com/android/android-sdk_r18-linux.tgz
5
+ - tar -zxf android-sdk_r18-linux.tgz
6
+
7
+ # This is a bit of a hack to get the android-15 arm abi installed
8
+ - wget http://dl.google.com/android/repository/sysimg_armv7a-15_r02.zip
9
+ - mkdir ~/builds/joelbyler/ADB/android-sdk-linux/system-images
10
+ - mkdir ~/builds/joelbyler/ADB/android-sdk-linux/system-images/android-15
11
+ - unzip sysimg_armv7a-15_r02.zip -d ~/builds/joelbyler/ADB/android-sdk-linux/system-images/android-15
12
+
13
+ # setup your ANDROID_HOME and PATH environment variables
14
+ # use ~/builds/[Github username]/[project]/android-sdk-linux
15
+ - export ANDROID_HOME=~/builds/joelbyler/ADB/android-sdk-linux
16
+ - export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
17
+
18
+ # only update the sdk for the tools and platform-tools (1,2) and whatever api level
19
+ # you are building for android (run "android list sdk" to get the full list. 9 = 2.3.3 or API level 10
20
+ #- android list sdk --all
21
+ - android update sdk -u -f --filter 1,2
22
+ - android update sdk -u -f --filter android-15
23
+
24
+ # Create an emulator for testing against
25
+ - echo no | android create avd -n Android_4.0.3 -t 1 --force
26
+ - echo "hw.ramSize=2048" >> ~/.android/avd/Android_4.0.3.i
27
+
28
+ # Need to figure out how to get the emulator to start up properly
29
+ #- emulator -avd Android_4.0.3 -port 5554 -no-window -no-audio -no-boot-anim &
30
+ #- adb wait-for-device
31
+
32
+ language: ruby
33
+ rvm:
34
+ - 1.9.3
35
+
36
+ #after_script:
37
+ #- bundle exec rake test
data/lib/ADB.rb CHANGED
@@ -11,7 +11,7 @@ require 'date'
11
11
  module ADB
12
12
  include ADB::Instrumentation
13
13
 
14
- attr_reader :last_stdout, :last_stderr
14
+ attr_reader :last_stdout, :last_stderr
15
15
 
16
16
  #
17
17
  # start the server process
@@ -159,11 +159,11 @@ module ADB
159
159
  # seconds.
160
160
  #
161
161
  def push(source, destination, target={}, timeout=30)
162
- execute_adb_with(timeout, "#{which_one(target)} push #{source} #{destination}")
162
+ execute_adb_with_exactly(timeout, "#{which_one(target)} push", source, destination)
163
163
  end
164
164
 
165
165
  #
166
- # push a file
166
+ # pull a file
167
167
  #
168
168
  # @param the fully quanified source (device) file name
169
169
  # @param the fully quanified destination (local) file name
@@ -173,7 +173,7 @@ module ADB
173
173
  # seconds.
174
174
  #
175
175
  def pull(source, destination, target={}, timeout=30)
176
- execute_adb_with(timeout, "#{which_one(target)} pull #{source} #{destination}")
176
+ execute_adb_with_exactly(timeout, "#{which_one(target)} pull", source, destination)
177
177
  end
178
178
 
179
179
  #
@@ -1,3 +1,3 @@
1
1
  module ADB
2
- VERSION = "0.5.2"
2
+ VERSION = "0.5.3"
3
3
  end
@@ -46,24 +46,37 @@ describe ADB do
46
46
  ADB.forward('src', 'dest')
47
47
  end
48
48
 
49
- it "should push a file" do
50
- should_call_adb_with('push', '/usr/foo.txt', '/sdcard/bar.txt')
51
- ADB.push('/usr/foo.txt', '/sdcard/bar.txt')
52
- end
49
+ context "when transferring files" do
53
50
 
54
- it "should pull a file" do
55
- should_call_adb_with('pull', '/usr/foo.txt', '/sdcard/bar.txt')
56
- ADB.pull('/usr/foo.txt', '/sdcard/bar.txt')
57
- end
51
+ it "should be able to push a file" do
52
+ should_call_adb_with(' push', '/usr/foo.txt', '/sdcard/bar.txt')
53
+ ADB.push('/usr/foo.txt', '/sdcard/bar.txt')
54
+ end
55
+
56
+ it "should be able to push a file with spaces in the name" do
57
+ should_call_adb_with(' push', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
58
+ ADB.push('/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
59
+ end
60
+
61
+ it "should be able to pull a file" do
62
+ should_call_adb_with(' pull', '/usr/foo.txt', '/sdcard/bar.txt')
63
+ ADB.pull('/usr/foo.txt', '/sdcard/bar.txt')
64
+ end
65
+
66
+ it "should be able to pull a file with spaces in the name" do
67
+ should_call_adb_with(' pull', '/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
68
+ ADB.pull('/usr/local file with spaces.txt', '/sdcard/remote file with spaces.txt')
69
+ end
58
70
 
59
- it "should be able to remount the /system drive" do
60
- should_call_adb_with('remount')
61
- ADB.remount
62
- end
71
+ it "should be able to remount the /system drive" do
72
+ should_call_adb_with('remount')
73
+ ADB.remount
74
+ end
63
75
 
64
- it "should be able to provide root access" do
65
- should_call_adb_with('root')
66
- ADB.root
76
+ it "should be able to provide root access" do
77
+ should_call_adb_with('root')
78
+ ADB.root
79
+ end
67
80
  end
68
81
 
69
82
  context "when connecting to a device" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ADB
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.2
4
+ version: 0.5.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-18 00:00:00.000000000 Z
13
+ date: 2012-09-19 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: childprocess
@@ -81,6 +81,7 @@ files:
81
81
  - cucumber.yml
82
82
  - features/ADB.feature
83
83
  - features/step_definitions/adb_steps.rb
84
+ - features/support/.travis.yml
84
85
  - features/support/ApiDemos.apk
85
86
  - features/support/env.rb
86
87
  - lib/ADB.rb
@@ -104,7 +105,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
104
105
  version: '0'
105
106
  segments:
106
107
  - 0
107
- hash: -4396733677998798054
108
+ hash: 2790238866883201100
108
109
  required_rubygems_version: !ruby/object:Gem::Requirement
109
110
  none: false
110
111
  requirements:
@@ -113,7 +114,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
114
  version: '0'
114
115
  segments:
115
116
  - 0
116
- hash: -4396733677998798054
117
+ hash: 2790238866883201100
117
118
  requirements: []
118
119
  rubyforge_project:
119
120
  rubygems_version: 1.8.24
@@ -123,6 +124,7 @@ summary: Simple wrapper over Android Debug Bridge command-line tool
123
124
  test_files:
124
125
  - features/ADB.feature
125
126
  - features/step_definitions/adb_steps.rb
127
+ - features/support/.travis.yml
126
128
  - features/support/ApiDemos.apk
127
129
  - features/support/env.rb
128
130
  - spec/lib/ADB/instrumentation_spec.rb