appcelerator

Getting started with appcelerator

Remarks#

Appcelerator Titanium is an open-source framework that allows the creation of mobile apps on platforms including iOS, Android and Windows Phone from a single JavaScript codebase, developed by Appcelerator.

Versions#

VersionRelease Date
5.5.1GA2016-09-29
5.5.0GA2016-09-13
5.4.0GA2016-08-10
5.3.1GA2016-07-06
5.3.0GA2016-06-02
5.2.2GA2016-04-04
5.2.1GA2016-03-23
5.2.02016-02-22
5.1.22016-01-12
5.1.12015-11-24
5.0.22015-10-01
5.0.12015-09-25
5.0.02015-09-16
4.1.12015-09-09
4.1.02015-07-08
4.0.02015-05-21
3.5.12015-03-06

Installation or Setup

Installing Appcelerator Titanium

At first we need to set up Titanium:

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

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

Linux (Fedora)

If you are using Fedora 23 you can run the following commands to get the needed libraries:

# install tools and libraries needed for android sdk
dnf install nodejs npm git gcc glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686

# intall npm version 4.2.2
npm install -g npm
npm install n -g
n 4.2.2

# install cli tools
npm install -g titanium alloy appcelerator tisdk
echo " PATH=$PATH:$HOME/.local/bin:$HOME/android-sdk-linux/tools:$HOME/android-sdk-linux/platform-tools:/usr/java/latest/bin"
echo " export ANDROID_SDK=$HOME/android-sdk-linux"
echo " export JAVA_HOME=/usr/java/latest"
echo "export PATH"

OSX / Windows

TODO: install node/npm on Windows / OSX

Open a console and run the following command to install the tools:

npm install -g titanium alloy tisdk

Titanium SDK

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
...

From this list we select the latest GA (4.1.0) and install 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 missing (How to install JDK and the Android SDK will follow)

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

get the newest SDK

The newest SDK is not available as a binary with tisdk. You have to compile it with:

tisdk build 5.0.0.GA

For more information, visit https://github.com/dbankier/tisdk and have a look at “Manual builds”

other methods

source: https://github.com/m1ga/titanium_with_atom#installing-appcelerator-titanium

Install Atom (and some useful packages)

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

Then install some Atom packages for easier Titanium coding:

Name Type Features
titanium language javascript Language JS Autocomplete (non alloy)
Titanium Alloy add-on All-in-one package
Jump to definition
Open related
TSS Highlight
Ti-Create add-on Create projects, controller, modules
Titanium-Build add-on Run in simulator (wip)

Other useful non-titanium packages/add-ons:

Name Features
Atom Beautify Code beautifier (tss, xml, js support)
minimap A preview of the full source code.
minimap-highlight-selected A minimap binding for the highlight-selected package
highlight-selected Highlights the current word selected when double clicking
pigments A package to display colors in project and files.
Linter A Base Linter core with Cow Powers (does nothing by itself, it’s an API base)
Linter-jshint Linter plugin for JavaScript (this checks your JS code)
DocBlockr A helper package for writing documentation
Terminal-plus A terminal package for Atom, complete with themes and more
Project Manager Project manager

source: https://github.com/m1ga/titanium_with_atom#install-atom-and-some-useful-packages

Create your first app

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 https://migaweb.de
cd APPNAME/
alloy new

This will create a basic app (name: APPNAME, bundle identifier: com.test, type: app, platform: all) and then 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 works inside an existing Alloy project (“Open folder” — select the project folder).

source: https://github.com/m1ga/titanium_with_atom#create-your-first-app

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

# iOS simulator - will show a menu to select the size/device
ti build -p ios -C ?

# iOS to ipa - will show a menu to select the keys
ti build -p ios --deploy-type production --ios-version 9.0 --keychain --target dist-adhoc --output-dir .
iOS related

To list all distribution names you can use:

security find-identity -v -p codesigning

source: https://github.com/m1ga/titanium_with_atom#compile-your-app


This modified text is an extract of the original Stack Overflow Documentation created by the contributors and released under CC BY-SA 3.0 This website is not affiliated with Stack Overflow