You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by Shazron <sh...@gmail.com> on 2015/03/03 22:37:14 UTC

[CLI] Default target when not specified for "build", "compile"?

What is the expected behaviour here?
`cordova build`

My expectation is that it would build for both device and emulator. In
iOS pre-3.8.0 it does, but now it only builds for emulator only after
the node.js script port, which may or may not be a bug depending on
consensus.

The online docs and cli docs do not give any clue regarding this.

What do other platforms experience?

The problem with building for both device and emulator is your build
times now approximately double.

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


Re: [CLI] Default target when not specified for "build", "compile"?

Posted by Shazron <sh...@gmail.com>.
Currently `cordova run` on iOS defaults to emulator as well, like the
compile/build commands.

It's probably safe to say we never specified what happens when no
target is specified (thus right now the behaviour is not consistent
for all platforms) -- and this is a new "feature request".


On Tue, Mar 3, 2015 at 2:50 PM, Michal Mocny <mm...@chromium.org> wrote:
> Imho, it should do what: "cordova run" would do.
>
> I would think it would run once for each platform, defaulting to device if
> attached.
>
> On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
>
>> What is the expected behaviour here?
>> `cordova build`
>>
>> My expectation is that it would build for both device and emulator. In
>> iOS pre-3.8.0 it does, but now it only builds for emulator only after
>> the node.js script port, which may or may not be a bug depending on
>> consensus.
>>
>> The online docs and cli docs do not give any clue regarding this.
>>
>> What do other platforms experience?
>>
>> The problem with building for both device and emulator is your build
>> times now approximately double.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>

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


Re: [CLI] Default target when not specified for "build", "compile"?

Posted by Shazron <sh...@gmail.com>.
There is no consensus on this.

See https://issues.apache.org/jira/browse/CB-8730. I will venture for
now that this bug is valid, because it broke the existing pre-3.7.0
behaviour, and the "fix" to make it build for emulator only was
unintended.




On Wed, Mar 4, 2015 at 7:20 AM, Michal Mocny <mm...@chromium.org> wrote:
> I think its fine to fail if the attached device isn't provisioned.  Perhaps
> we could append a message explaining `cordova run --emulator` or `cordova
> emulate` commands, but I think even that is not necessary.
>
> My personal expectation is that once I plug in a device using a cable, I
> very likely want to actually develop on it.
>
> -Michal
>
> On Tue, Mar 3, 2015 at 6:08 PM, Shazron <sh...@gmail.com> wrote:
>
>> Defaulting to device might be problematic on iOS: sure we can detect
>> if a device is attached (using iso-deploy), but the build might fail
>> because a signing cert/provisioning profile is not valid (I think the
>> only way to check is to just build, I might be wrong).
>>
>> The only "guaranteed" way it will always run is through emulator (at
>> least on iOS).
>>
>> On Tue, Mar 3, 2015 at 2:50 PM, Michal Mocny <mm...@chromium.org> wrote:
>> > Imho, it should do what: "cordova run" would do.
>> >
>> > I would think it would run once for each platform, defaulting to device
>> if
>> > attached.
>> >
>> > On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
>> >
>> >> What is the expected behaviour here?
>> >> `cordova build`
>> >>
>> >> My expectation is that it would build for both device and emulator. In
>> >> iOS pre-3.8.0 it does, but now it only builds for emulator only after
>> >> the node.js script port, which may or may not be a bug depending on
>> >> consensus.
>> >>
>> >> The online docs and cli docs do not give any clue regarding this.
>> >>
>> >> What do other platforms experience?
>> >>
>> >> The problem with building for both device and emulator is your build
>> >> times now approximately double.
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> >> For additional commands, e-mail: dev-help@cordova.apache.org
>> >>
>> >>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>

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


Re: [CLI] Default target when not specified for "build", "compile"?

Posted by Michal Mocny <mm...@chromium.org>.
I think its fine to fail if the attached device isn't provisioned.  Perhaps
we could append a message explaining `cordova run --emulator` or `cordova
emulate` commands, but I think even that is not necessary.

My personal expectation is that once I plug in a device using a cable, I
very likely want to actually develop on it.

-Michal

On Tue, Mar 3, 2015 at 6:08 PM, Shazron <sh...@gmail.com> wrote:

> Defaulting to device might be problematic on iOS: sure we can detect
> if a device is attached (using iso-deploy), but the build might fail
> because a signing cert/provisioning profile is not valid (I think the
> only way to check is to just build, I might be wrong).
>
> The only "guaranteed" way it will always run is through emulator (at
> least on iOS).
>
> On Tue, Mar 3, 2015 at 2:50 PM, Michal Mocny <mm...@chromium.org> wrote:
> > Imho, it should do what: "cordova run" would do.
> >
> > I would think it would run once for each platform, defaulting to device
> if
> > attached.
> >
> > On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
> >
> >> What is the expected behaviour here?
> >> `cordova build`
> >>
> >> My expectation is that it would build for both device and emulator. In
> >> iOS pre-3.8.0 it does, but now it only builds for emulator only after
> >> the node.js script port, which may or may not be a bug depending on
> >> consensus.
> >>
> >> The online docs and cli docs do not give any clue regarding this.
> >>
> >> What do other platforms experience?
> >>
> >> The problem with building for both device and emulator is your build
> >> times now approximately double.
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> >> For additional commands, e-mail: dev-help@cordova.apache.org
> >>
> >>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>

RE: [CLI] Default target when not specified for "build", "compile"?

Posted by Nikhil Khandelwal <ni...@microsoft.com>.
FWIW, on WP8 I made a fix a month back for 'cordova run' to pick device if plugged in & fallback to emulator to match Android behavior. For windows & wp8, building itself for device or emulator is not different currently.

Can we detect the build failure in iOS because of signing cert/provisioning profile issue and fallback to emulator? Of course, if this detection is slow - it might be a bit annoying for existing users who use cordova run instead of cordova emulate with the intention to launch it on the emulator.

Thanks,
Nikhil


-----Original Message-----
From: Shazron [mailto:shazron@gmail.com] 
Sent: Tuesday, March 3, 2015 3:09 PM
To: dev@cordova.apache.org
Subject: Re: [CLI] Default target when not specified for "build", "compile"?

Defaulting to device might be problematic on iOS: sure we can detect if a device is attached (using iso-deploy), but the build might fail because a signing cert/provisioning profile is not valid (I think the only way to check is to just build, I might be wrong).

The only "guaranteed" way it will always run is through emulator (at least on iOS).

On Tue, Mar 3, 2015 at 2:50 PM, Michal Mocny <mm...@chromium.org> wrote:
> Imho, it should do what: "cordova run" would do.
>
> I would think it would run once for each platform, defaulting to 
> device if attached.
>
> On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
>
>> What is the expected behaviour here?
>> `cordova build`
>>
>> My expectation is that it would build for both device and emulator. 
>> In iOS pre-3.8.0 it does, but now it only builds for emulator only 
>> after the node.js script port, which may or may not be a bug 
>> depending on consensus.
>>
>> The online docs and cli docs do not give any clue regarding this.
>>
>> What do other platforms experience?
>>
>> The problem with building for both device and emulator is your build 
>> times now approximately double.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>

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


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

Re: [CLI] Default target when not specified for "build", "compile"?

Posted by Shazron <sh...@gmail.com>.
Defaulting to device might be problematic on iOS: sure we can detect
if a device is attached (using iso-deploy), but the build might fail
because a signing cert/provisioning profile is not valid (I think the
only way to check is to just build, I might be wrong).

The only "guaranteed" way it will always run is through emulator (at
least on iOS).

On Tue, Mar 3, 2015 at 2:50 PM, Michal Mocny <mm...@chromium.org> wrote:
> Imho, it should do what: "cordova run" would do.
>
> I would think it would run once for each platform, defaulting to device if
> attached.
>
> On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
>
>> What is the expected behaviour here?
>> `cordova build`
>>
>> My expectation is that it would build for both device and emulator. In
>> iOS pre-3.8.0 it does, but now it only builds for emulator only after
>> the node.js script port, which may or may not be a bug depending on
>> consensus.
>>
>> The online docs and cli docs do not give any clue regarding this.
>>
>> What do other platforms experience?
>>
>> The problem with building for both device and emulator is your build
>> times now approximately double.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
>> For additional commands, e-mail: dev-help@cordova.apache.org
>>
>>

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


RE: [CLI] Default target when not specified for "build", "compile"?

Posted by Josh Soref <js...@blackberry.com>.
Fwiw, BlackBerry 10 is building both (tested w/ cordova 4.3.1-dev and 
blackberry10 3.7.0):

$ cordova -v
4.3.1-dev (cordova-lib@4.2.1-dev)
$ cordova platform update blackberry10
Updating blackberry10 project...
BlackBerry10 project is now at version 3.7.0
$ cordova build
Running command: "platforms/blackberry10/cordova/build"
[WARN]    Using legacy signing keys
[INFO]    Populating application source
[INFO]    Parsing config.xml
[INFO]    Generating output files
[INFO]    Package created: platforms/blackberry10/build/simulator/bb10app.bar
[INFO]    Package created: platforms/blackberry10/build/device/bb10app.bar
[INFO]    BAR packaging complete

(all paths excised)

> -----Original Message-----
> From: mmocny@google.com [mailto:mmocny@google.com] On Behalf Of
> Michal Mocny
> Sent: Tuesday, March 03, 2015 5:50 PM
> To: dev
> Subject: Re: [CLI] Default target when not specified for "build", "compile"?
>
> Imho, it should do what: "cordova run" would do.
>
> I would think it would run once for each platform, defaulting to device if
> attached.
>
> On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:
>
> > What is the expected behaviour here?
> > `cordova build`
> >
> > My expectation is that it would build for both device and emulator. In
> > iOS pre-3.8.0 it does, but now it only builds for emulator only after
> > the node.js script port, which may or may not be a bug depending on
> > consensus.
> >
> > The online docs and cli docs do not give any clue regarding this.
> >
> > What do other platforms experience?
> >
> > The problem with building for both device and emulator is your build
> > times now approximately double.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> > For additional commands, e-mail: dev-help@cordova.apache.org
> >
> >

Re: [CLI] Default target when not specified for "build", "compile"?

Posted by Michal Mocny <mm...@chromium.org>.
Imho, it should do what: "cordova run" would do.

I would think it would run once for each platform, defaulting to device if
attached.

On Tue, Mar 3, 2015 at 4:37 PM, Shazron <sh...@gmail.com> wrote:

> What is the expected behaviour here?
> `cordova build`
>
> My expectation is that it would build for both device and emulator. In
> iOS pre-3.8.0 it does, but now it only builds for emulator only after
> the node.js script port, which may or may not be a bug depending on
> consensus.
>
> The online docs and cli docs do not give any clue regarding this.
>
> What do other platforms experience?
>
> The problem with building for both device and emulator is your build
> times now approximately double.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
> For additional commands, e-mail: dev-help@cordova.apache.org
>
>