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

Merging #1267 (52ebdd1) into master (fb36e03) will decrease coverage by 0.33%.
The diff coverage is 86.36%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
bin/templates/cordova/lib/run.js 92.59% <80.00%> (-3.41%) ⬇️
bin/templates/cordova/lib/target.js 92.06% <84.61%> (-2.39%) ⬇️
bin/templates/cordova/lib/emulator.js 98.43% <100.00%> (-0.07%) ⬇️
...n/templates/cordova/lib/builders/ProjectBuilder.js 70.96% <0.00%> (-2.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb36e03...52ebdd1. Read the comment docs.

@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.

None yet

3 participants