@@ -76,7 +76,7 @@ def install(program_name, message, script, run_as_root = false, show_all_option
76
76
end
77
77
78
78
def install_environment_variable ( name , value )
79
- ENV [ name ] = value
79
+ ENV [ name ] = value . to_s
80
80
81
81
execute ( "echo \" export #{ name } =#{ value } \" >> ~/.bash_profile" , "Unable to set #{ name } " )
82
82
@@ -93,7 +93,7 @@ def install_environment_variable(name, value)
93
93
end
94
94
95
95
install ( "Java SE Development Kit" , "Installing the Java SE Development Kit... This might take some time, please, be patient. (You will be prompted for your password)" , 'brew cask install java' , false , false )
96
- install ( "Android SDK" , "Installing Android SDK" , 'brew install android-sdk' , false )
96
+ install ( "Android SDK" , "Installing Android SDK" , 'brew tap caskroom/cask; brew cask install android-sdk' , false )
97
97
98
98
unless ENV [ "ANDROID_HOME" ]
99
99
require 'pathname'
@@ -129,30 +129,31 @@ def install_environment_variable(name, value)
129
129
# the android tool will introduce a --accept-license option in subsequent releases
130
130
error_msg = "There seem to be some problems with the Android configuration"
131
131
132
- android_executable = File . join ( ENV [ "ANDROID_HOME" ] , "tools" , "android" )
133
- execute ( "echo y | #{ android_executable } update sdk --filter platform-tools --all --no-ui" , error_msg )
134
- execute ( "echo y | #{ android_executable } update sdk --filter tools --all --no-ui" , error_msg )
135
- execute ( "echo y | #{ android_executable } update sdk --filter android-23 --all --no-ui" , error_msg )
136
- execute ( "echo y | #{ android_executable } update sdk --filter build-tools-25.0.2 --all --no-ui" , error_msg )
137
- execute ( "echo y | #{ android_executable } update sdk --filter build-tools-23.0.3 --all --no-ui" , error_msg )
138
- execute ( "echo y | #{ android_executable } update sdk --filter extra-android-m2repository --all --no-ui" , error_msg )
139
- execute ( "echo y | #{ android_executable } update sdk --filter extra-google-m2repository --all --no-ui" , error_msg )
132
+ android_executable = File . join ( ENV [ "ANDROID_HOME" ] , "tools" , "bin" , "sdkmanager" )
133
+ execute ( "echo y | #{ android_executable } \" platform-tools\" " , error_msg )
134
+ execute ( "echo y | #{ android_executable } \" tools\" " , error_msg )
135
+ execute ( "echo y | #{ android_executable } \" build-tools;25.0.2\" " , error_msg )
136
+ execute ( "echo y | #{ android_executable } \" platforms;android-25\" " , error_msg )
137
+ execute ( "echo y | #{ android_executable } \" platforms;android-24\" " , error_msg )
138
+ execute ( "echo y | #{ android_executable } \" platforms;android-23\" " , error_msg )
139
+ execute ( "echo y | #{ android_executable } \" platforms;android-22\" " , error_msg )
140
+ execute ( "echo y | #{ android_executable } \" platforms;android-21\" " , error_msg )
141
+ execute ( "echo y | #{ android_executable } \" platforms;android-19\" " , error_msg )
142
+ execute ( "echo y | #{ android_executable } \" platforms;android-18\" " , error_msg )
143
+ execute ( "echo y | #{ android_executable } \" platforms;android-17\" " , error_msg )
140
144
141
145
puts "Do you want to install Android emulator? (y/n)"
142
146
if gets . chomp . downcase == "y"
143
147
puts "Do you want to install HAXM (Hardware accelerated Android emulator)? (y/n)"
144
148
if gets . chomp . downcase == "y"
145
- execute ( "echo y | #{ android_executable } update sdk --filter extra- intel- Hardware_Accelerated_Execution_Manager --all --no-ui " , error_msg )
146
-
149
+ execute ( "echo y | #{ android_executable } \" extras; intel; Hardware_Accelerated_Execution_Manager\" " , error_msg )
150
+
147
151
haxm_silent_installer = File . join ( ENV [ "ANDROID_HOME" ] , "extras" , "intel" , "Hardware_Accelerated_Execution_Manager" , "silent_install.sh" )
148
- execute ( "#{ haxm_silent_installer } " , "There seem to be some problems with the Android configuration" )
149
-
150
- execute ( "echo y | #{ android_executable } update sdk --filter sys-img-x86-android-23 --all --no-ui" , error_msg )
151
- execute ( "echo no | #{ android_executable } create avd -n Emulator-Api23-Default -t android-23 --abi default/x86 -c 12M -f" , error_msg )
152
- else
153
- execute ( "echo y | #{ android_executable } update sdk --filter sys-img-armeabi-v7a-android-23 --all --no-ui" , error_msg )
154
- execute ( "echo no | #{ android_executable } create avd -n Emulator-Api23-Default -t android-23 --abi default/armeabi-v7a -c 12M -f" , error_msg )
152
+ execute ( "sudo #{ haxm_silent_installer } " , "There seem to be some problems with the Android configuration" )
153
+ else
155
154
end
155
+ execute ( "echo y | #{ android_executable } \" system-images;android-25;google_apis;x86\" " , error_msg )
156
+ execute ( "echo y | #{ android_executable } \" system-images;android-24;default;x86\" " , error_msg )
156
157
end
157
158
158
159
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .bash_profile/.zprofile"
0 commit comments