Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Download and install Node.js from http://nodejs.org/#download, which includes the npm package manager needed to install the Appcelerator CLI.
  2. From a terminal, run the following command to install the CLI: 

    Code Block
    languagebash
    [sudo] npm install appcelerator -g
  3. After installation, run the setup command to install required components: 

    Code Block
    languagebash
    appc setup

    After the CLI downloads and installs the required components, you will be prompted to login and authorize your computer.  The CLI will ask to send an authorization token to your e-mail account or as a text to your mobile phone.  Enter the authorization token once you receive it to complete the registration process.

Create a project

Using Studio

To create a new Alloy project, start Appcelerator Studio, then

...

To create a new Alloy project, use the Appcelerator CLI to create a new Alloy project. Run the following command in a terminal:

Code Block
languagebash
langnone
appc new -t titanium

...

Replace the contents of app/styles/index.tss with the following:

Code Block
titleapp/styles/index.tss
languagejs
langcss
"Window": {
	backgroundColor:"white"
},
"#l":{
	bottom:20,
	width: Ti.UI.SIZE,
	height: Ti.UI.SIZE,
	color:'#999'
},
"#imageView":{
	image:"/images/apple_logo.jpg",
	width:24,
	height:24,
	top:100
}

...

Replace the contents of app/controllers/index.js with the following:

Code Block
titleapp/controllers/index.js
languagejs
langjavascript
function clickImage(e) {
	Titanium.UI.createAlertDialog({title:'Image View', message:'You clicked me!'}).show();
}

$.index.open();

...

From a console window, go to the root directory of the project, then

Code Block
languagebash
langnone
appc run [-p platform]

...