Its fairly straight forward if you create one project then copy the coocs2d folder back up one directory. Now if you put all your projects down one folder from here and change the paths in android and ios projects back up one directory it will all link against the one cocos2d folder here is an example structure
Cocos2d
Projects
3.Project 1.
4.Project 2.
So inside each project just change the search paths and add an extra "…/’ to each path
Well on ios you will have to delete and re-add the cocos2d libs xcode project as it will be in red.
On Android just look through all files in the project and change the paths that you need to change
build-cfg.json
settings.gradle
app/jni/Android.mk
I’ve already managed to do this. Keep using the standard console command for creating a new project.
After you create the project structure with the cocos command, delete the cocos2d folder in your project folder, then run the following command inside that project folder where cocos2d was previously (this is on Windows, but you should be able to apply this method to other platforms):
Command to create links: mklink /D Link Target
For example:
mklink /D cocos2d c:\cocos\cocos2d-3.14.1
It will create a soft link to the cocos folder you want to use.