nativescript-cli icon indicating copy to clipboard operation
nativescript-cli copied to clipboard

feat: only install corresponding abi package when possible

Open farfromrefug opened this issue 3 years ago • 1 comments

This PR changes the way the installOnDevice works. The idea is to be compatible with apk split on android. The reason for this is multiple:

  • much smaller apps on device/emulator. It gets really boring to get warning about emulator not having enough space.
  • faster install
  • it is the first step to other features like only build device ABI

The way it works is this:

  • track device abis (might be multiple as a 64 device almost always accept 32bit apks).
  • When deploying see how many .apk files were built: - 1: always install this one - more than 1: if 64bit abi or 32bit abi package found use this one - more than 1: if not look for universal one found use this one - otherwise => error

I also applied the same rule for copy copyLatestAppPackage To (thus renamed to copyAppPackages )

  • if copyTo is an existing directory or a path which does not end with aab|ipa|apk copy all packages to copyTo as a directory
  • if copyTo is a file name
    • if only one package in output dir then copy it
    • copy only universal package if existing

There is one thing bugging be for which i have not found a solution. Because of this line if there are multiple packages there will be warning about it which is wrong in its meaning when using run. Might also be wrong in other cases and we can simply remove the warning ...

farfromrefug avatar Feb 20 '22 20:02 farfromrefug

@rigor789 i updated that PR with my latest changes. I now check for changes on next builds to see if the arch of the device is different from the arch of what we built previously. It now works in all cases

farfromrefug avatar Nov 09 '23 08:11 farfromrefug