Skip to content

Getting started with Appcelerator Titanium (OSS Version) and Atom

Notifications You must be signed in to change notification settings

abada/titanium_with_atom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 

Repository files navigation

Getting started with Appcelerator Titanium (OSS Version) and Atom

Since version 4 of Appcelerator Titanium there are two version of Titanium: the 'Appcelerator Platform' (with Appcelerator Studio, Arrow,..) and the open source version 'Appcelerator Titanium' (http://appcelerator.org/). In this tutorial I'm talking about a way to get started with the open source Titanium in combination with Atom as an editor on Linux (you could use other editors like Sublime, but that's not part of this tutorial).

main view

Installing Appcelerator Titanium

The current 'general availability' version of the SDK is 4.1.0GA

At first we need to setup Titanium:

  • command line tools (CLI) to compile the apps
  • the MVC framework Alloy
  • some useful tools
  • the SDK

The main parts are installed using the node.js package manager 'npm'. Check https://nodejs.org/ if you need to install it.

Now open a console and run the following command to install the tools:

npm install -g titanium alloy tisdk

After that we need to install the SDK. To do this we will the cli tool tisdk from David Bankier (https://github.com/dbankier/tisdk):

# list available titanium sdks
tisdk list

The output will be something like this

4.1.0.GA
4.1.0.Beta
4.0.0.RC5
4.0.0.RC4
4.0.0.RC3
4.0.0.RC2
4.0.0.RC
4.0.0.GA
4.0.0.Beta4
4.0.0.Beta3
4.0.0.Beta2
3.5.1.RC
3.5.1.GA
3.5.1.Alpha
3.5.0.RC3
3.5.0.RC2
3.5.0.RC

From this list we select the latest GA (4.1.0) and istall it

tisdk install 4.1.0.GA

with this command you can check if titanium found the sdk:

ti sdk list

and with

ti info

you can see if something is missig (How to install JDK and the Android SDK will follow)

You are ready to create titanium/alloy projects now and compile them! Time to setup the editor

Install atom and some useful packages

Goto https://atom.io/ and install the atom editor.

When you have it running open the settings (strg + ,) and install some packages:

Create your first app

For this tutorial we are just creating an empty Alloy app using CLI and Atom.

Open a new terminal and add the following :

ti create --id com.test -d . -n APPNAME -p all -t app -u http://migaweb.de
cd APPNAME/
alloy new

This will create a basic app (name: APPNAME, bundle identifier: com.test, type:app, platform: all) and the convert it into an Alloy project.

You can also use the Atom package ti-create

main view

It will create a new project inside the folder that is open in the tree-view. 'Create controller/widget' only work inside an existing Alloy project ("Open folder" - select the project folder).

Compile your app

There are several ways to compile your app. You can use the simulator/emulator, deploy it to your device or create store apk's/ipa's. There is also a live test tool (TiShadow) which saves you a lot of time waiting for the compiler.

cli way

# android to device
ti build -p android  -T device

# android to store/file
ti build -p android -K /home/user/keyfile.keystore -T dist-playstore

Shortcuts

You can save yourself a lot of typing when you define some aliases (e.g. 'tq' will run the whole ti command to compile it and deploy it to the connected android device) In Linux/OSX you open the .bashrc file and add the following aliases:

alias tq='ti build -p android  -T device --skip-js-minify'
alias tbs='ti build -p android -K /home/user/keyfile.keystore -T dist-playstore'

then you can just write "tq" to compile and install on your connected device or write "tbs" to build an apk for the play store.

TiShadow

TiShadow is another great tool by David Bankier (https://github.com/dbankier/TiShadow)

TiShadow provides Titanium developers the ability to deploy apps, run tests or execute code snippets live across all running iOS and Android devices.

It allows you to quickly test your app on multiple devices at the same time and 'compiles' quicker then building your app all the time (about 5 seconds to get your app up and running on an android phone, for a small app). Also it works over wifi, so you don't have to have your device connected.

Link list

Here are some useful Titanium ressources:

Contact me

Feedback appreciated.

About

Getting started with Appcelerator Titanium (OSS Version) and Atom

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published