NativeScript / NativeScript/nativescript-cli
LiveSync related commands build applications for not needed architectures
还没有人认领这个 Issue。
- 主要语言
- JavaScript
- 星标
- 1.1k
- 派生
- 204
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 8
描述
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.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从与 liveSync 相关的 tns run、tns debug 和 tns test 命令路径入手,检查 iOS 构建如何使用 App_Resources/iOS/build.xcconfig。使用 tns run ios --log trace 在 iOS 9.x 或 10.x Simulator 上重现,然后将所选架构与正在使用的 Simulator 或设备进行比较。完成的标准是只构建所需的架构,同时不破坏文档中说明的 deployment target 行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- ios, javascript
- 领域
- build-system, cli, mobile
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100