> Cocos package

Cocos package


Integrate 3rd party SDKs into our cocos2d-x game, all the plugins are created and maintained by SDKBOX


usage: cocos package [-h] [-v] [-p [PROJECT]] [-b [PLUGIN]] [-D SYMBOL] [-q]
                     [-d [DAYS]] [--china] [--dryrun] 


Command Description
import [name] imports the package 'name' into your project. For a list of names, see the list command. You can also specify local archived packages or a directory by specifying the -b option (see above).
update re-imports all imported packages to update them to the latest version. If you have imported packages prior to v0.5.6.19 then you must manually import your packages again to add them to the package manifest.
info displays the packages that have been imported into your project. If you have packages imported that are not in the package manifest, will alert you as to which packages it thinks are imported.
restore restores your project to the latest backup that can be found. If you have made changes to your project files since importing, this will overwrite your changes, so use carefully.
list list available and cached packages installed on your machine. The package repository is located in your home directory.
clean [N] removes all packages older than N days.
symbols displays the symbols that are used to drive the import process. These symbols are very useful for debugging, so if you have issues, and post on the forums, please include the symbols if possible.


switch alternate switch what it does
-h --help show this help message and exit
-v --verbose specify verbosity level
-p PROJECT --project PROJECT path to project root (defaults to .)
-b PLUGIN --plugin PLUGIN specify path to plugin (defaults to .)
-D SYMBOL --symbol SYMBOL define a symbol for the package script
-q --nohelp don't open online documentation after installation.
-d [DAYS] --days [DAYS] specify number of days of logs and packages to keep
--china use China based server instead of US
--dryrun test install before performing.
--forcedownload force download of package even if it is already downloaded.
--noupdate ignore available updates.
--patcherrors patch failures are counted as errors instead of warnings.
--nopatching skip all patching commands when executing package script.


// Add 'In App Purchase' plugin to your game
$ cocos package import -b iap -p /path/to/your/cocos2dx/game/
// When you use this command under a cocos2d-x project
$ cocos package import iap
// If you have a package directory you may specify it too
$ cocos package -b /path/to/your/package
// List all available packages on the server
$ cocos package list
//Show all package imported into your project
$ cocos package info
//clean logs and packages older than 5 days
$ cocos package clean 5

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.