How to use cocos2d-x github code as cocos framework for cocos studio?

Looks like all you need is a file called version in the root of your frameworks/cocos2d-x-3.9 folder with the version pasted in it.
Example contents of version file: cocos2d-x-3.9

Edit:
Also, I needed to do the following:

  1. Copy templates and tools folders from a previous install of Cocos With Framework into the same location in Cocos Without Framework. Note: NOT the templates and tools folders inside the framework/cocos2d-x
  2. manually set paths in tools/cocos-console/bin/cocos2d.ini