This time in the tossing cocos2d-x engine telnet console, a few days ago to add an upload command, In the testcpp console test added the corresponding test example, however, I have not found a convenient method to use in the command line. I have studied it again today. I have a satisfactory solution (tested on mac ):
1. xcode compiled testcpp mac project, it is best to cocos2d-x repository develop Branch latest code (https://github.com/cocos2d/cocos2d-x/), but these two weeks to add new functions OH ~
2. Open the Terminal command line,
3. If you want to upload the file bbq.jpg, enter the following command:
Echo-n "upload bbq.jpg"> upload. cmd
Stat-f "% z" bbq.jpg> upload. cmd
Cat upload. cmd bbq.jpg | nc localhost 5678
The file is uploaded to the writable directory of the cocos2d-x.
Note:
Nc is a well-known netcat. It is a perfect alternative to telnet,
If you are running an ios or android device project, change localhost to the IP address of the corresponding device. Make sure that the development machine and the device are on the same intranet.
Where is the writable directory?
You can run the fileutils command on the console to view the information:
Nc localhost 5678 [Press enter]
> Fileutils [Press enter]
Find:
Writeble Path:
/Users/heliclei/Documents/
In fact, this upload directory should be printed directly in the upload Command...