【问题标题】:Why is the Titanium build process so slow?为什么 Titanium 构建过程如此缓慢?
【发布时间】:2013-02-26 16:39:00
【问题描述】:

我有一台 2013 年的 Retina MacBook pro,我对 XCode 的构建速度感到惊讶。我可以在大约 2-3 秒内在模拟器中构建并运行一个相当大的 Objective-C 应用程序。

在为 iPhone 构建和运行较小的 Titanium 应用程序时,大约需要 15 秒,我想知道为什么。在控制台中,构建过程确实很快,但应用程序在“Invoking xcodebuild”上挂了大约 10 秒

$ titanium build -p ios
Titanium Command-Line Interface, CLI version 3.0.24, Titanium SDK version 3.0.2.v20130206164716
Copyright (c) 2012-2013, Appcelerator, Inc.  All Rights Reserved.

Please report bugs to http://jira.appcelerator.org/

[INFO]  Build type: development
[INFO]  Building for target: simulator
[INFO]  Building using iOS SDK: 6.1
[INFO]  Building for iOS iPhone Simulator: 6.1
[INFO]  Building for device family: iphone
[INFO]  Minimum iOS version: 4.3
[INFO]  Debugging disabled
[INFO]  Initiating prepare phase
[INFO]  Copying custom Info.plist from project directory
[INFO]  Forcing rebuild: custom Info.plist CFBundleIdentifier not equal to tiapp.xml <id>
[INFO]  No Titanium Modules required, continuing
[INFO]  Cleaning old build directory
[INFO]  Performing full rebuild
[INFO]  Copying Xcode iOS files
[INFO]  Creating Xcode project directory: .../build/iphone/MyProject.xcodeproj
[INFO]  Writing Xcode project data file: Titanium.xcodeproj/project.pbxproj
[INFO]  Writing Xcode project configuration: project.xcconfig
[INFO]  Writing Xcode module configuration: module.xcconfig
[INFO]  Creating symlinks for simulator build
[INFO]  Forcing rebuild: ApplicationDefaults.m has changed since last build
[INFO]  Writing properties to ApplicationDefaults.m
[INFO]  No module resources to copy
[INFO]  No CommonJS modules to copy
[INFO]  Invoking xcodebuild

我能做些什么来加快速度吗?

【问题讨论】:

    标签: titanium appcelerator titanium-mobile appcelerator-mobile


    【解决方案1】:

    其实在objective-c中你可以直接运行app,需要2-3秒,但是在

    钛首先将javascript转换为objective-c,然后将此objective-c转换为本机应用程序,因此需要一些时间..但是一旦您编译了应用程序。第二次运行不会花费太多时间,依此类推。因为一旦创建了构建。它只会在构建和运行中进行很少的更改..除了第一次运行其他运行所需的时间更少..但有时可能需要尽管 。 .我们无法估计时间

    【讨论】:

    • 我知道 - JS->ObjC 构建时间几乎是即时的,但过程中的“调用 xcodebuild”步骤花费了太长时间。检查我的答案以获得解决方案。
    • afaik,JS代码不会转换成Object C,钛做的只是在不同平台上“运行js代码”。
    【解决方案2】:

    我在Appcelerator QA Question 上得到了导致问题解决的提示

    日志中的这一行暗示了每次完整构建的原因:

    Forcing rebuild: custom Info.plist CFBundleIdentifier not equal to tiapp.xml <id>
    

    我的项目中有一个自定义 Info.plist,每次都复制到 XCode 项目中。我已将 tiapp.xml &lt;id&gt; 属性更改为与 CFBundleIdentifier 相同,现在构建在不到 4 秒的时间内完成。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-11-15
      • 2014-08-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-19
      • 2011-05-03
      • 2017-09-01
      相关资源
      最近更新 更多