-
-
Notifications
You must be signed in to change notification settings - Fork 197
Create Android default emulator #1794
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,11 +114,30 @@ def install(program_name, message, script, run_as_root = false, show_all_option | |
puts "Configuring your system for Android development... This might take some time, please, be patient." | ||
# Note that multiple license acceptances may be required, hence the multiple commands | ||
# the android tool will introduce a --accept-license option in subsequent releases | ||
error_msg = "There seem to be some problems with the Android configuration" | ||
|
||
android_executable = File.join(ENV["ANDROID_HOME"], "tools", "android") | ||
execute("echo y | #{android_executable} update sdk --filter platform-tools --all --no-ui", "There seem to be some problems with the Android configuration") | ||
execute("echo y | #{android_executable} update sdk --filter tools --all --no-ui", "There seem to be some problems with the Android configuration") | ||
execute("echo y | #{android_executable} update sdk --filter android-23 --all --no-ui", "There seem to be some problems with the Android configuration") | ||
execute("echo y | #{android_executable} update sdk --filter build-tools-23.0.2 --all --no-ui", "There seem to be some problems with the Android configuration") | ||
execute("echo y | #{android_executable} update sdk --filter extra-android-m2repository --all --no-ui", "There seem to be some problems with the Android configuration") | ||
execute("echo y | #{android_executable} update sdk --filter platform-tools --all --no-ui", error_msg) | ||
execute("echo y | #{android_executable} update sdk --filter tools --all --no-ui", error_msg) | ||
execute("echo y | #{android_executable} update sdk --filter android-23 --all --no-ui", error_msg) | ||
execute("echo y | #{android_executable} update sdk --filter build-tools-23.0.2 --all --no-ui", error_msg) | ||
execute("echo y | #{android_executable} update sdk --filter extra-android-m2repository --all --no-ui", error_msg) | ||
|
||
puts "Do you want to install Android emulator? (y/n)" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark as in the powershell script - it's better to use the |
||
if gets.chomp.downcase == "y" | ||
puts "Do you want to install HAXM (Hardware accelerated Android emulator)? (y/n)" | ||
if gets.chomp.downcase == "y" | ||
execute("echo y | $ANDROID_HOME/tools/android update sdk --filter extra-intel-Hardware_Accelerated_Execution_Manager --all --no-ui", error_msg) | ||
|
||
haxm_silent_installer = File.join(ENV["ANDROID_HOME"], "extras", "intel", "Hardware_Accelerated_Execution_Manager", "silent_install.sh") | ||
execute("#{haxm_silent_installer}", "There seem to be some problems with the Android configuration") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be re-written as: execute(haxm_silent_installer, error_msg) |
||
|
||
execute("echo y | $ANDROID_HOME/tools/android update sdk --filter sys-img-x86-android-23 --all --no-ui", error_msg) | ||
execute("echo no | $ANDROID_HOME/tools/android create avd -n Emulator-Api23-Default -t android-23 --abi default/x86 -c 12M -f", error_msg) | ||
else | ||
execute("echo y | $ANDROID_HOME/tools/android update sdk --filter sys-img-armeabi-v7a-android-23 --all --no-ui", error_msg) | ||
execute("echo no | $ANDROID_HOME/tools/android create avd -n Emulator-Api23-Default -t android-23 --abi default/armeabi-v7a -c 12M -f", error_msg) | ||
end | ||
end | ||
|
||
puts "The ANDROID_HOME and JAVA_HOME environment variables have been added to your .profile. Restart the terminal to use them." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use the
Install
function here instead of asking the user explicitly.The purpose of the
Install
function is that the user may specify that that everything should be installed with no further questions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've decided that we want to ask explicitly if Android emulator should be installed and what kind of emulator will be used. We don't want to install both emulators.