How could I set apple icon image (xxx.icns) to file or folder?
Right click the file and click "Get Info" (or press Cmd+I on the file). Drag the desired icon onto the current icon and it will replace the existing one.