安装环境
[email protected] ~ $ npm install -g cordova npm WARN deprecated [email protected]: use uuid module instead C:\Users\Peng\AppData\Roaming\npm\cordova -> C:\Users\Peng\AppData\Roaming\npm\n ode_modules\cordova\bin\cordova [email protected] C:\Users\Peng\AppData\Roaming\npm\node_modules\cordova ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] (object-assign[email protected], [email protected], [email protected], lodash.debou [email protected], [email protected], [email protected], [email protected], [email protected], re [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], underscore @1.8.3, [email protected], [email protected], [email protected], [email protected], [email protected], she [email protected], [email protected], [email protected], [email protected], [email protected]) └── [email protected] ([email protected], [email protected] , [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], init-p [email protected], [email protected], [email protected], [email protected], cordova-c [email protected]) [email protected] ~ $ cordova -v ? May Cordova anonymously report usage statistics to improve the tool over time? ? May Cordova anonymously report usage statistics to improve the tool over time? No You have been opted out of telemetry. To change this, run: cordova telemetry on. 6.5.0 [email protected] ~ $ cordova -v 6.5.0
创建项目:
[email protected] /D/home/cordova-workspace $ cordova create mycordova com.example.hello helloWorld Creating a new cordova project. [email protected]-PC /D/home/cordova-workspace $ cd mycordova/ [email protected]-PC /D/home/cordova-workspace/mycordova $ cordova platforms ls Installed platforms: Available platforms: amazon-fireos ~3.6.3 (deprecated) android ~6.1.1 blackberry10 ~3.8.0 browser ~4.1.0 firefoxos ~3.6.3 webos ~3.7.0 windows ~4.4.0 wp8 ~3.8.2 (deprecated) [email protected]-PC /D/home/cordova-workspace/mycordova $ cordova platform add android Adding android project... Creating Cordova project for the Android platform: Path: platforms\android Package: com.example.hello Name: helloWorld Activity: MainActivity Android target: android-25 Subproject Path: CordovaLib Android project created with cordova[email protected]6.1.2 Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the pro ject Fetching plugin "[email protected]" via npm Installing "cordova-plugin-whitelist" for android This plugin is only applicable for versions of cordova-android gr eater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in. [email protected]-PC /D/home/cordova-workspace/mycordova $ cordova build android Error: Failed to find ‘ANDROID_HOME‘ environment variable. Try setting setting i t manually. Failed to find ‘android‘ command in your ‘PATH‘. Try update your ‘PATH‘ to inclu de path to valid SDK directory.
时间: 2024-10-18 14:05:36