Installing Ionic

Installing Ionic
Ionic apps are created and developed primarily through the Ionic command line utility (the “CLI”), and use Cordova to build and deploy as a native app. This means we need to install a few utilities to get developing.
Ionic CLI and Cordova
To create Ionic projects, you’ll need to install the latest version of the CLI and Cordova. Before you do that, you’ll need a recent version of Node.js.  Download the installer  for NodeLTS and then proceed to install the Ionic CLI and Cordova for native app development:
$ npm install -g ionic cordova
You may need to add “sudo” in front of these commands to install the utilities globally
Once that’s done, create your first Ionic app:
$ ionic start cutePuppyPics
Add  --type=ionic1  if you’d like to use Ionic 1. To run your app,  cd  into the directory that was created and then run the  ionic serve  command to test your app right in the browser!
$ cd cutePuppyPics $ ionic serve


增加平台
ionic platform add android
ionic platform add ios

编译
ionic build

// 在浏览器中运行项目
运行调试,修改实时更新
ionic serve

安装到手机运行
ionic cordova run android

ionic cordova build android --prod --release

ionic cordova build android --prod --release --aot=false

增加新的页面
ionic generate page Login

$ keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
输入密钥库口令:
再次输入新口令:
您的名字与姓氏是什么?
[Unknown]: pengfei zhu
您的组织单位名称是什么?
[Unknown]: yorkg
您的组织名称是什么?
[Unknown]: yorkg
您所在的城市或区域名称是什么?
[Unknown]: zhengzhou
您所在的省/市/自治区名称是什么?
[Unknown]: henan
该单位的双字母国家/地区代码是什么?
[Unknown]: cn
CN=pengfei zhu, OU=yorkg, O=yorkg, L=zhengzhou, ST=henan, C=cn是否正确?
[否]: y

正在为以下对象生成 2,048 位RSA密钥对和自签名证书 (SHA256withRSA) (有效期为 10,000 天):
CN=pengfei zhu, OU=yorkg, O=yorkg, L=zhengzhou, ST=henan, C=cn
输入 <alias_name> 的密钥口令
(如果和密钥库口令相同, 按回车):
再次输入新口令:
[正在存储my-release-key.keystore]


jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore -signedjar android-release-signed.apk android-release-unsigned.apk alias_name
jarsigner -keystore my-release-key.keystore -signedjar android-release-signed.apk android-release-unsigned.apk alias_name

zipalign -v 4 android-release-signed.apk android-release.apk

发布了22 篇原创文章 · 获赞 15 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/zhupengfei/article/details/78652135