Skip to content
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

Update Android emulator path to support SDK Tools >=25.3.0 #700

Merged
merged 2 commits into from
May 19, 2018

Conversation

elyalvarado
Copy link
Contributor

Since Android SDK Tools 25.3.0 (March 2017) The Android Emulator was removed from the SDK Tools package and moved to a different SDK directory: Android Emulator v15.3.0 release notes

Also, according to this issue in the google issue tracker the new path is also the preferred way of invoking the emulator, and the old path will at some point be deprecated / removed.

For recent API versions (and depending on the OS architecture) running the old tools/emulator can cause errors because the different architecture versions of the emulator won't be found in the tools folder of the Android SDK. By example, I'm using the Android SDK v27 build tools and the latest versions of all the Android tools, and when running the emulator with the command that detox uses I get the following errors:

usr/local/share/android-sdk/tools/emulator -verbose -gpu host -no-audio @Nexus_5_API_27
emulator:Android emulator version 26.0.3.0 (build_id 3965150)
emulator:Found AVD name 'Nexus_5_API_27'
emulator:Found AVD target architecture: x86
emulator:argv[0]: '/usr/local/share/android-sdk/tools/emulator'; program directory: '/usr/local/share/android-sdk/tools'
emulator:  Found directory: /usr/local/share/android-sdk/system-images/android-27/google_apis/x86/

emulator:Probing for /usr/local/share/android-sdk/system-images/android-27/google_apis/x86//kernel-ranchu: file missing
emulator:Auto-config: -engine classic (based on configuration)
emulator:  Found directory: /usr/local/share/android-sdk/system-images/android-27/google_apis/x86/

emulator:try dir /usr/local/share/android-sdk/tools
emulator:Looking for emulator-x86 to emulate 'x86' CPU
emulator:Probing program: /usr/local/share/android-sdk/tools/emulator64-x86
emulator:Probing program: /usr/local/share/android-sdk/tools/emulator-x86
PANIC: Missing emulator engine program for 'x86' CPU.

Given that from August this year the minimum target version required for submitting apps to the Play store will be API 26, the path of the emulator should be updated.

Since Android SDK Tools 25.3.0 (March 2017) The Android Emulator was removed from the SDK Tools package and moved to a different SDK directory. 
For recent API versions (and depending on the OS architecture) running the old tools/emulator can cause errors because the different architecture versions of the emulator won't be found in the tools folder of the Android SDK.
Given that from August this year the minimum target version required for submitting apps to the Play store will be API 26, the path of the emulator should be updated.
@elyalvarado elyalvarado requested a review from rotemmiz as a code owner April 29, 2018 23:55
@noomorph
Copy link
Collaborator

I think it would be better to support both paths in order of preference than just drastically switch to another location.

Anyway your observation is very nice. To my embarrassment, I also had this problem, but didn’t figure out the reason behind it, so I’ve been fiddling with folders and files in my SDK till it worked. Now I know, thanks!

Updated the constructor to use the new Emulator path if it exists, or else continue using the old emulator path. This allows backward compatibility with users of older Android SDK versions.
@elyalvarado
Copy link
Contributor Author

@noomorph you're right. I've updated the pull request to check first if the new emulator path exists before using it, and otherwise falling back to the previous path.

@noomorph
Copy link
Collaborator

@rotemmiz , actually this is a useful pull request 👍 . Today I was lazy to get AVD with API 26 on the other MacBook, so I tried to run the project on Nexus API 27 and only with the change in PR it works.

What do you think? Maybe we can fix a couple of things in PR if there's something you don't like and merge? Why not?

@rotemmiz
Copy link
Member

Sure! Lets do it!

@rotemmiz rotemmiz changed the title Update Android Emulator Path Update Android emulator path to support SDK Tools >=25.3.0 May 19, 2018
@rotemmiz rotemmiz merged commit cfdc279 into wix:master May 19, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants