You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/06/02 16:44:24 UTC

[jira] [Commented] (CB-9080) Cordova CLI run for Android versions 4.1.1 and lower throws error

    [ https://issues.apache.org/jira/browse/CB-9080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14569185#comment-14569185 ] 

ASF subversion and git services commented on CB-9080:
-----------------------------------------------------

Commit c9e7201058df0d01adbda27cf44344721d273a85 in cordova-android's branch refs/heads/master from [~bowserj]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=c9e7201 ]

CB-9080: -d option is not supported on Android 4.1.1 and lower, removing


> Cordova CLI run for Android versions 4.1.1 and lower throws error
> -----------------------------------------------------------------
>
>                 Key: CB-9080
>                 URL: https://issues.apache.org/jira/browse/CB-9080
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CLI
>    Affects Versions: 5.0.0
>         Environment: Cordova CLI 5.0.0
> Cordova Lib 5.0.0 
> Mac Yosemite 10.10.2
> Android platform tools 22
> Android 4.1
>            Reporter: Josh Bavari
>            Assignee: Joe Bowser
>
> When running `cordova run android` and an Android v4.1 device connected, the `adb` command fails.
> You can read more about the error on the Ionic CLI issues, as ionic calls cordova: https://github.com/driftyco/ionic-cli/issues/441
> Looking at the source code, the `device.js` file will try to run this command:
> 'adb install -s ' + resolvedTarget.target + ' -r -d "' + apk_path + '"'
> As you can see, it passes the -d option, which works fine for most android 4.2+ devices.
> However, when Android 4.1 is involved, this error occurs:
> ```
> BUILD SUCCESSFUL
> Total time: 2.551 secs
> Built the following apk(s):
>     /Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk
> Using apk: /Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk
> Installing app on device...
> Running this command to install app to device: adb -s 192.168.56.102:5555 install -r -d "/Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk"
> OUTPUT: Error: Unknown option: -d
> usage: pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [FILTER]
>        pm list permission-groups
>        pm list permissions [-g] [-f] [-d] [-u] [GROUP]
>        pm list instrumentation [-f] [TARGET-PACKAGE]
>        pm list features
>        pm list libraries
>        pm path PACKAGE
>        pm install [-l] [-r] [-t] [-i INSTALLER_PACKAGE_NAME] [-s] [-f]
>                   [--algo <algorithm name> --key <key-in-hex> --iv <IV-in-hex>] PATH
>        pm uninstall [-k] PACKAGE
>        pm clear PACKAGE
>        pm enable PACKAGE_OR_COMPONENT
>        pm disable PACKAGE_OR_COMPONENT
>        pm disable-user PACKAGE_OR_COMPONENT
>        pm grant PACKAGE PERMISSION
>        pm revoke PACKAGE PERMISSION
>        pm set-install-location [0/auto] [1/internal] [2/external]
>        pm get-install-location
>        pm set-permission-enforced PERMISSION [true|false]
> ```
> Now when I run with an Android 4.4 device attached:
> ```
> Total time: 2.585 secs
> Built the following apk(s):
>     /Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk
> Using apk: /Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk
> Installing app on device...
> Running this command to install app to device: adb -s 192.168.56.101:5555 install -r -d "/Users/JoshBavari/Development/testing/s1/platforms/android/build/outputs/apk/android-debug.apk"
> OUTPUT: 	pkg: /data/local/tmp/android-debug.apk
> Success
> Launching application...
> LAUNCH SUCCESS
> ```
> My guess here is that this is an issue with the `adb` tool.
> Can anyone else confirm this is an issue? The adb tool does not work with `-d` on Android 4.1.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org