NativeScript / NativeScript/nativescript-cli
LiveSync related commands build applications for not needed architectures
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 204
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
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
i386andx86_64architectures. Similarly when you build for iOS Device, in the log you'll seearmv7andarm64.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the liveSync-related tns run, tns debug, and tns test command paths and inspect how iOS builds consume App_Resources/iOS/build.xcconfig. Reproduce with an iOS 9.x or 10.x Simulator using tns run ios --log trace, then compare the architectures selected with the simulator or device in use. Done means only the required architectures are built without breaking the documented deployment-target behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, javascript
- Domain
- build-system, cli, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100