Cordora

根据 创建你的第一个App 整理

安装codora

npm install -g cordova

创建第一个项目

cordova create hello com.example.hello HelloWorld

添加iOS和Android平台

1
2
3
4
cd hello
cordova platform add ios --save
cordova platform add android --save
cordova platform ls

安装构建先决条件

检测: cordova requirements

安装JDK

1
2
3
4
5
sudo add-apt-repository ppa:openjdk-r/ppa
sudo apt-get update
sudo apt-get install openjdk-8-jdk
sudo apt-get install openjdk-8-jre
sudo apt-get install openjdk-8-source #this is optional, the jdk source code

安装Android SDK

方法一(待尝试)

1
sudo apt-get install android-tools-adb

方法二(尝试中)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# download android sdk
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz

tar -xvf android-sdk_r24.2-linux.tgz
cd android-sdk-linux/tools

# install all sdk packages
./android update sdk --no-ui

# set path(wether )
vi ~/.zshrc << EOT

export PATH=${PATH}:$HOME/workspace/hello/android-sdk-linux/platform-tools:$HOME/workspace/hello/android-sdk-linux/tools:$HOME/workspace/hello/android-sdk-linux/build-tools/23.0.1/

EOT

source ~/.zshrc

# adb
sudo apt-get install libc6:i386 libstdc++6:i386
# aapt
sudo apt-get install zlib1g:i386

方法三

1
2
sudo apt-get install ubuntu-make
umake android

0%