Description
Environment
Provide version numbers for the following components (information can be retrieved by running tns info
in your project folder or by inspecting the package.json
of the project):
- CLI: 5.1.1
- Cross-platform modules: Not applicable
- Android Runtime: Not applicable
- iOS Runtime: Not applicable
- Plugin(s): Not applicable
Describe the bug
During liveSync related commands, like tns run
, tns debug
, tns test
, CLI may build the application as it have to install it on devices. However, CLI does not use the architectures of the devices/emulators that will be used and builds for the default ones. This means that in most cases the build result (.ipa, .app) is larger than required and the build is much slower as it is done for multiple architectures.
To Reproduce
$ tns create myApp --js
$ cd myApp
- Start iOS 9.x or 10.x Simulator
- Run
tns run ios --log trace
- Check the logs - you'll see both
i386
andx86_64
architectures. Similarly when you build for iOS Device, in the log you'll seearmv7
andarm64
.
Expected behavior
To build the app only for the required architectures that will be used during this command.
Additional context
For iOS builds, in case you set IPHONEOS_DEPLOYMENT_TARGET = 11.0
in <path to App_Resources>/iOS/build.xcconfig
, Xcode will build only for 64 bits (i.e. arm64
or x86_64
).
Similar thing will happen in case we pass ONLY_ACTIVE_ARCH=YES
, so Xcode will automatically detect running simulators/attached devices.
NOTE: By default our project template for Xcode has deployment target set to 9, so in case it is not set in build.xcconfig and ONLY_ACTIVE_ARCH is set to NO, Xcode will build the application for all supported architectures.