Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the Titanium build process so slow?

I have a 2013 Retina MacBook pro and am amazed by the XCode build speed. I can build and run a fairly large Objective-C app in the simulator in about 2-3 seconds.

When building and running a smaller Titanium App for iPhone, it takes about 15 seconds an I am wondering why. In the console, the build process is really fast, but the app hangs for about 10 seconds on "Invoking xcodebuild"

$ 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

Is there anything I can do to make this faster?

like image 294
nanoman Avatar asked Mar 11 '13 13:03

nanoman


2 Answers

I got the hint that lead to the solution of the problem on my Appcelerator QA Question

The cause of the full build each time was hinted by this line in the logs:

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

I have a custom Info.plist in my project which is copied to the XCode project each time. I have changed the tiapp.xml <id> property be identical to CFBundleIdentifier and the build goes through now in less than 4 seconds.

like image 129
nanoman Avatar answered Oct 22 '22 17:10

nanoman


Actually in objective-c You directly can run the app which takes you 2-3 seconds but in

titanium first javascript is converted to objective-c and then this objective-c to the native app so it takes a little while ..but once you compiled the app . it will not take much time for second run and so on.since once built has been created .it just makes little changes in built and run ..except for first time it takes less time for other run..but some times it may take while . . we cannot estimate the time

like image 26
sundar nataraj Avatar answered Oct 22 '22 18:10

sundar nataraj