cordova打包成android安裝包

2021-10-04 16:40:49 字數 2416 閱讀 4219

安裝cordova,命令列npm install -g cordova

c:\users\97849>cnpm install -g cordova

[1/8] editor@^1.0.0 installed at node_modules\[email protected]@editor

[2/8] configstore@^4.0.0 installed at node_modules\[email protected]@configstore

[3/8] loud-rejection@^2.0.0 installed at node_modules\[email protected]@loud-rejection

[4/8] nopt@^4.0.1 installed at node_modules\[email protected]@nopt

[5/8] cordova-common@^3.1.0 installed at node_modules\[email protected]@cordova-common

[6/8] update-notifier@^2.5.0 installed at node_modules\[email protected]@update-notifier

[7/8] cordova-lib@^9.0.0 installed at node_modules\[email protected]@cordova-lib

[8/8] insight@^0.10.1 installed at node_modules\[email protected]@insight

deprecate [email protected] › md5-file@^4.0.0 this module is looking for a new maintainer.

2020-03-31

[email protected] › underscore@^1.8.3(1.10.2) (05:28:31)

[email protected][email protected] › @types/[email protected] › @types/node@*(13.9.8) (07:56:03)

2020-03-27

[email protected] › signal-exit@^3.0.2(3.0.3) (03:32:54)

2020-03-25

[email protected][email protected] › psl@^1.1.28(1.8.0) (21:29:13)

all packages installed (403 packages installed from npm registry, used 7s(network 6s), speed 944.95kb/s, json 370(924.73kb), tarball 4.74mb)

建立專案

進入專案目錄,開啟命令視窗,window在路徑輸入cmd即可快捷開啟

執行命令:  cordova create  子專案名    package包名   應用名

這邊如果遇到以下問題的夥伴請看下,這個原因是因為cordova版本太高的原因,解決辦法是降低cordova版本到6.0.0

新增專案後我們可以看到資料夾多了乙個資料夾,接下來用命令列進入專案根目錄,列f:\farmer\cordovademo\csdndemo

執行cordova platforms ls,檢查你的電腦支援的平台

接下來新增android工程

輸入命令列 cordova platform add android

構建應用

輸入命名行 cordova build android

build失敗一般原因都是因為

因為android sdk和gradle沒有配置好的原因,如下是android sdk配置好,但gradle配置問題

error: failed to find 'android_home' environment variable. try setting setting it manually.

failed to find 'android' command in your 'path'. try update your 'path' to include path to valid sdk directory.

這個時候需要去檢查下gradle是否配置好。

cordova 打包步驟

增加執行環境的模板 cordova platform add android 編譯android的程式 cordova build release android 生成簽名檔案 keytool genkey v keystore hdratv release.keystore alias hdrat...

python檔案打包成exe

將自己寫的python檔案壓縮成exe有兩種方法 1 使用pyinstaller step1 安裝pyinstaller,在cmd視窗使用pip install pyinstaller安裝 step2 cd 到你的檔案目錄cd d py python testcases slice step3 執行...

python 打包成exe程式

1.需要安裝 py2exe 2.示例 exetest.py 建立乙個gui介面,只用乙個標籤和按鈕,無功能 from tkinter import win tk label label win,text hello btn button win,text click label.pack btn.p...