Cocos2d-x: how to upload files through command lines

Source: Internet
Author: User

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...


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.