After the lua script is modified, xcode needs to be re-compiled to update it. This is an old problem in xcode. There are some scripts on the Internet, but they are not the project directories for Cocos Code IDE, which are listed here.
Cocos2dx version 3.1
Select a project in Xcode, and the project setting interface is displayed on the right.
Select the Build Phases tab from the settings page, click the Add Build Phases button in the lower right corner, and select "Add Run Script ".
Enter the following content in the new Run Script column:
_TARGET_BUILD_CONTENTS_PATH=$TARGET_BUILD_DIR/$CONTENTS_FOLDER_PATHecho _TARGET_BUILD_CONTENTS_PATH: $_TARGET_BUILD_CONTENTS_PATHecho PWD: $PWDecho Cleaning $_TARGET_BUILD_CONTENTS_PATH/rm -fr "$_TARGET_BUILD_CONTENTS_PATH/Resources/res/*"rm -fr "$_TARGET_BUILD_CONTENTS_PATH/Resources/src/*" mkdir -p "$_TARGET_BUILD_CONTENTS_PATH/Resources/res/"mkdir -p "$_TARGET_BUILD_CONTENTS_PATH/Resources/src/" cp -RLp $PWD/../../../res/* "$_TARGET_BUILD_CONTENTS_PATH/Resources/res/"cp -RLp $PWD/../../../src/* "$_TARGET_BUILD_CONTENTS_PATH/Resources/src/"