Fix a Cocos Creator 3.x iOS hot update that reaches 100% but still loads old code after restart by restoring the hot-update search paths correctly.
A hot-update implementation that worked on Android reached 100% and restarted successfully on iOS, but the game continued running old code. The updated files may already be on disk; the usual cause is that iOS startup did not restore the hot-update search paths before loading bundled resources.
Troubleshooting
Check the Cocos Creator 3.x Hot-Update Directory
My source path was -s ${path.join(result.dest, resdir)}:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
exports.onAfterBuild = function (options, result) { let resdir = 'assets';
I called setSearchPaths only when the update finished. After the restart, I did not restore those paths early in the game startup process, so iOS continued loading the old code.