This is a rare requirement, but it's a very hard test, so keep track of the memo.
We use Jenkins+texturepacker to automate the packaging and conversion of resources.
Texturepacker first run requires a user acknowledgement that the agree is entered on the command line for the copyright notice. Jenkins's system environment is independent of the desktop system, so in Jenkins you have to enter agree again. So there is a very disgusting situation, Jenkins inside run texturepacker command line does not give the user input agree place.
Fortunately there are all-purpose python scripts. It can simulate the user's input. This only needs to execute this script in Jenkins (create a job,execute shell to run the following script)
#!python.exeimport subprocesshalls = subprocess. Popen ([R ' D:\Workspace\TexturePacker\bin\TexturePacker.exe '], stdin=subprocess. PIPE, Stdout=subprocess. PIPE) result = Halls.communicate (input=r ' agree ') [0] Print halls.returncodeprint halls.communicate ()
Simulating user input in the Python script of Jenkins