Dear Wiki user, You have subscribed to a wiki page or wiki category on "Cordova Wiki" for change notification.
The "CommandLineToolingDesign" page has been changed by FilMaj: https://wiki.apache.org/cordova/CommandLineToolingDesign?action=diff&rev1=18&rev2=19 Comment: Updated support list for project-level scripts - Proposal for project-level, cross-platform, available in each cordova implementation, command-line scripts. + Specification for both library and project-level command-line scripts for Cordova platform libraries. = High-Level Organization = + + == Library-level == + + {{{ + cordova-* + `bin + |-create + `-check_reqs + }}} + + + == Project-level == {{{ myapp @@ -21, +33 @@ `-list-started-emulators }}} - Anything that is necessary for a platform's basic CLI tooling (e.g. `ApplicationInfo` on Android) can be placed under `cordova/lib`. + Anything additional that is necessary for a platform's basic CLI tooling (e.g. `ApplicationInfo` on Android) can be placed under `cordova/lib`. = Errors = The following exit codes should be considered standard: * 1: not implemented / unsupported command - * 2: generic runtime error. Hopefully accompanied with `stderr` output. + * 2: generic runtime error. Accompanied with `stderr` output. - = Specification = + = Annotations = (./) = implemented {X} = not implemented /!\ = sort of implemented / possible + + = Library-level Script Specification = + + = Project-level Script Specification = == Flow for Multiple Devices/Emulators == @@ -61, +77 @@ Current implementations: * (./) Android: `ant clean`, which boils down to `rm -rf bin gen` - * (./) iOS - * /!\ BlackBerry: available via `ant TARGET clean` - * {X} WP7 - * {X} WP8 + * (./) iOS: `xcodebuild -alltargets clean && rm -rf build` + * (./) BlackBerry: `rm -rf build` + * (./) WP7: `rm -rf obj && rm -rf Build` + * (./) WP8: `rm -rf obj && rm -rf Build` == `log` == @@ -73, +89 @@ Current implementations: * (./) Android: `adb logcat` - * /!\ iOS: `tail -f "$CORDOVA_PATH/console.log"`, but only works for simulator + * (./) iOS: `tail -f "$CORDOVA_PATH/console.log"` (only works for simulator) * {X} BlackBerry: no support at this time. Web Inspector direct on device or simulator available, though. * {X} WP7 * {X} WP8 - {{{#!wiki caution - '''Outstanding Issues''' - - For the `log` command - }}} - - * Does the multi-device flow (section above) apply correctly to the `log` case? It seems identifying whether the user's Cordova application is running on an emulator or device target would need to be figured out. - == `build` == {{{ @@ -97, +105 @@ Current implementations: * (./) Android w/ `--debug`: `ant debug` - * /!\ Android w/ `--release`: `ant release` (but currently implemented as a separate `release` script) + * (./) Android w/ `--release`: `ant release` + * (./) iOS w/ `--debug` + * (./) iOS w/ `--release` + * (./) BlackBerry w/ `--debug` + * (./) BlackBerry w/ `--release` + * (./) WP7 w/ `--debug` + * (./) WP7 w/ `--release` + * (./) WP8 w/ `--debug` + * (./) WP8 w/ `--release` + + == `run` == + + {{{ + run [--target=<id>] + }}} + + Deploys a build of the app to an available device or emulator. If `--target` is specified, attempts to deploy the app to the device or emulator identified by `<id>`. If the attempt fails, the script will error out with code 2. If no `--target` is specified, follows the multi-device flow as detailed above. Implicitly calls `build` first. + + Current implementations: + + * (./) Android * (./) iOS - * /!\ BlackBerry w/ `--debug` (currently implemented as a separate `debug` script) - * {X} BlackBerry w/ `--release`: not implemented but feasible by tweaking the build.xml to set `code.sign` to true + * (./) BlackBerry + * (./) WP7 + * (./) WP8 + + == Helper Scripts == + + If we can also standardize on some of the helper scripts located under `cordova/lib`, that would be helpful! + + === `list-emulator-images` === + + Lists out available emulator image IDs. Its main use is passing into `start-emulator`. The script should print out, at a minimum, one emulator ID per line. If a description of the emulator image is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. + + * (./) Android + * (./) iOS + * (./) BlackBerry + * (./) WP7 + * (./) WP8 + + === `list-started-emulators` === + + Lists out running emulators. The script should print out, at a minimum, one emulator ID per line. If a description of the running emulator is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. + + * (./) Android + * (./) iOS + * (./) BlackBerry * {X} WP7 * {X} WP8 - == `run` == + === `list-devices` === + Lists out attached/connected devices. The script should print out, at a minimum, one device ID per line. If a description of the device is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. - {{{ - run [--target=<id>] - }}} - Deploys a build of the app to an available device or emulator. If `--target` is specified, attempts to deploy the app to the device or emulator identified by `<id>`. If the attempt fails, the script will error out with code 2. If no `--target` is specified, follows the multi-device flow as detailed above. Implicitly calls `build` first. + * (./) Android + * (./) iOS + * (./) BlackBerry + * (./) WP7 + * (./) WP8 - Current implementations: + === `install-emulator` === - * /!\ Android: rudimentary support. Explicitly has user choose an AVD via interactive input if no device available and no emulator running, and multiple AVDs defined. - * /!\ iOS: rudimentary support. Only deploys to simulator via ios-sim. Could install [[http://github.com/phonegap/ios-deploy|ios-deploy]] at install-time to do device deployment. - * /!\ BlackBerry: rudimentary support. Interactive input required to specify whether to load to device or simulator. + {{{ + install-emulator [--target=id] + }}} + + Installs a build of the app to an available emulator. If `--target` is specified, attempts to install the app to the emulator identified by `<id>`. If the attempt fails, the script will error out. If no `--target` is specified, follows the multi-device flow as detailed above (but only for emulators). If the application is not compiled/built yet, the script will error out and exit with code 2. + + * (./) Android + * (./) iOS + * {X} BlackBerry + * (./) WP7 + * (./) WP8 + + === `install-device` === + + {{{ + install-device [--target=id] + }}} + + Installs a build of the app to an available device. If `--target` is specified, attempts to install the app to the device identified by `<id>`. If the attempt fails, the script will error out. If no `--target` is specified, follows the multi-device flow as detailed above (but only for devices). If the application is not compiled/built yet, the script will error out and exit with code 2. + + * (./) Android + * (./) iOS + * {X} BlackBerry + * (./) WP7 + * (./) WP8 + + === `start-emulator` === + + {{{ + start-emulator [id] + }}} + + Starts an emulator image. If `id` is specified, will attempt to start the emulator image with the specified ID, or, if not available or unable to start, errors out. If no `id` is specified, it will try to start the first available emulator. If no emulator images are available, it will error out and exit with code 2. + + * (./) Android + * (./) iOS + * (./) BlackBerry * {X} WP7 * {X} WP8 - == Helper Scripts == - - If we can also standardize on some of the helper scripts located under `cordova/lib`, that would be helpful! - - === `list-emulator-images` === - - Lists out available emulator image IDs. Its main use is passing into `start-emulator`. The script should print out, at a minimum, one emulator ID per line. If a description of the emulator image is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. - - * {X} Not Implemented - * /!\ Android: rudimentary support (can use `android list avd` and parse that). - * /!\ iOS: fixed image support (based on images available when installing Xcode 4.6/iOS 6). - - === `list-started-emulators` === - - Lists out running emulators. The script should print out, at a minimum, one emulator ID per line. If a description of the running emulator is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. - - * {X} Not Implemented - * (./) iOS - * /!\ Android: rudimentary support available - - === `list-devices` === - - Lists out attached/connected devices. The script should print out, at a minimum, one device ID per line. If a description of the device is available, each line should be in the form `ID DESCRIPTION`. Other tooling can then use the first space as a delimiter. - - * {X} Not Implemented - * (./) Android (`adb devices`) - - === `install-emulator` === - - {{{ - install-emulator [--target=id] - }}} - - Installs a build of the app to an available emulator. If `--target` is specified, attempts to install the app to the emulator identified by `<id>`. If the attempt fails, the script will error out. If no `--target` is specified, follows the multi-device flow as detailed above (but only for emulators). If the application is not compiled/built yet, the script will error out and exit with code 2. - - * (./) Android - * (./) iOS - * (./) BlackBerry - * {X} WP7 - * {X} WP8 - - === `install-device` === - - {{{ - install-device [--target=id] - }}} - - Installs a build of the app to an available device. If `--target` is specified, attempts to install the app to the device identified by `<id>`. If the attempt fails, the script will error out. If no `--target` is specified, follows the multi-device flow as detailed above (but only for devices). If the application is not compiled/built yet, the script will error out and exit with code 2. - - * (./) Android - * {X} iOS - Could install using [[http://github.com/phonegap/ios-deploy|ios-deploy]] at install-time to do device deployment. - * (./) BlackBerry - * {X} WP7 - * {X} WP8 - - === `start-emulator` === - - {{{ - start-emulator [id] - }}} - - Starts an emulator image. If `id` is specified, will attempt to start the emulator image with the specified ID, or, if not available or unable to start, errors out. If no `id` is specified, it will try to start the first available emulator. If no emulator images are available, it will error out and exit with code 2. - - * (./) Android - * (./) iOS - * (./) BlackBerry - * {X} WP7 - * {X} WP8 - === `version` === {{{ @@ -197, +215 @@ Returns the Cordova version. - * {X} Android + * (./) Android * (./) iOS - * {X} BlackBerry + * (./) BlackBerry - * {X} WP7 - * {X} WP8 + * (./) WP7 + * (./) WP8
