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

refactor: use target SDK of built APK to determine best emulator #1267

Merged
merged 2 commits into from
Jul 12, 2021

Conversation

raphinesse
Copy link
Contributor

@raphinesse raphinesse commented Jul 11, 2021

Motivation and Context

This reduces usage of check_reqs.get_target since that function only considers config.xml to find the target SDK and moreover relies on the script location to find config.xml (which has to change if we want to run the script from node_modules; also see #1265).

Description

When looking for the best emulator image to run an APK on, the target SDK of that APK is determined by running apkanalyzer manifest target-sdk.

apkanalyzer is part of the Android SDK Tools since Revision 26.1.1 (September 2017).

Testing

  • ran unit tests
  • manually tested that the correct SDK is inferred from the built APK during cordova run

@codecov-commenter
Copy link

codecov-commenter commented Jul 11, 2021

Codecov Report

Attention: Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.

Project coverage is 71.15%. Comparing base (fb36e03) to head (52ebdd1).
Report is 138 commits behind head on master.

Files with missing lines Patch % Lines
bin/templates/cordova/lib/target.js 84.61% 2 Missing ⚠️
bin/templates/cordova/lib/run.js 80.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1267      +/-   ##
==========================================
- Coverage   71.48%   71.15%   -0.34%     
==========================================
  Files          21       21              
  Lines        1645     1650       +5     
==========================================
- Hits         1176     1174       -2     
- Misses        469      476       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@raphinesse raphinesse merged commit 70a1eff into apache:master Jul 12, 2021
@raphinesse raphinesse deleted the use-apk-target-sdk-for-best-emu branch July 12, 2021 07:48
wedgberto pushed a commit to wedgberto/cordova-android that referenced this pull request May 17, 2022
…che#1267)

* refactor(emulator): require emulatorId in emulator.run

* refactor: use effective targetSdk to find best emulator
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants