Skip to content

LiveSync related commands build applications for not needed architectures #4339

Open
@rosen-vladimirov

Description

@rosen-vladimirov

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

  1. $ tns create myApp --js
  2. $ cd myApp
  3. Start iOS 9.x or 10.x Simulator
  4. Run tns run ios --log trace
  5. Check the logs - you'll see both i386 and x86_64 architectures. Similarly when you build for iOS Device, in the log you'll see armv7 and arm64.

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions