NativeScript / NativeScript/nativescript-cli

LiveSync related commands build applications for not needed architectures

Aperta
#4,339 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug livesync os: ios os: mac severity: medium ux
Lingua principale
JavaScript
Stelle
1.1k
Fork
204
Merge medio
1g 9h
PR unite (30g)
8

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dai percorsi dei comandi tns run, tns debug e tns test relativi a liveSync e verifica come le build iOS utilizzano App_Resources/iOS/build.xcconfig. Riproduci il problema con un Simulator iOS 9.x o 10.x usando tns run ios --log trace, quindi confronta le architetture selezionate con il Simulator o il dispositivo in uso. Il lavoro è completato quando vengono compilate solo le architetture necessarie senza alterare il comportamento documentato del deployment target.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
ios, javascript
Ambito
build-system, cli, mobile
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.