离子运行android - 配置未在设备

时间:2016-02-28 05:02:47

标签: android debugging ionic-framework adb

我正在尝试在我的Android设备上构建和调试 ionic 2 app 。 以下是我尝试运行命令 ionic run android

时控制台输出的详细信息
#->ionic run android

∆ Compiling Sass to CSS
√ Matching patterns: app/theme/app.+(ios|md).scss

∆ Copying fonts
√ Matching patterns: node_modules/ionic-framework/fonts/**/*.+(ttf|woff|woff2)

∆ Copying HTML
√ Matching patterns: app/**/*.html

∆ Compiling and bundling with Webpack...
√ Using your webpack.config.js file
√ Sass compilation complete
√ HTML copied to www/build
√ Fonts copied to www/build/fonts
√ Compiling files complete.

Hash: 3239d7653edd2f88c126
Version: webpack 1.12.10
Time: 6745ms
        Asset     Size  Chunks             Chunk Names
app.bundle.js  2.68 MB       0  [emitted]  main
   [0] multi main 64 bytes {0} [built]
    + 362 hidden modules

√ Webpack complete

#->

我的应用 Androidmanifest.xml 包含:

<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="22" />

当我按照 adb devices 命令运行时,我可以看到设备已连接。

List of devices attached
5b234380    device

以下是 Android SDK Manager

中安装的软件包的屏幕截图

Screenshot of Android SDK Manager 1 Screenshot of Android SDK Manager 2 Screenshot of Android SDK Manager 3

这也是我informations系统的ionic

#->ionic info

Your system information:

Cordova CLI: 4.3.1
Ionic Version: 2.0.0-beta.1
Ionic CLI Version: 2.0.0-beta.17
Ionic App Lib Version: 2.0.0-beta.8
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Not installed


******************************************************
 Dependency warning - for the CLI to run correctly,      
 it is highly suggested to install/upgrade the following:     

 Install ios-sim to deploy iOS applications. `npm install -g ios-sim` (may require sudo)
 Install ios-deploy to deploy iOS applications to devices. `npm install -g ios-deploy` (may require sudo)

******************************************************

我只想立即在Android设备上运行,因此未安装ios-simios-deploy个软件包。

Update 当我尝试运行添加平台android时,它说已经存在:

#->ionic  platform add android
Running command: /Users/Piccaza/ionic-projects/fobs-v0.9.9/hooks/before_platform_add/init_directories.js /Users/Piccaza/ionic-projects/fobs-v0.9.9
Platform android already added.

这可能是什么问题,所以我无法在设备上运行应用程序?我有点困难了2天请帮忙。

1 个答案:

答案 0 :(得分:0)

而不只是ionic run android我尝试使用sudo,如下所示:

  

<强> sudo ionic run android

应用程序开始在设备中运行。

注意:如果我们执行命令,ionic不会显示任何错误或警告: 的 ionic run android