sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/Installer --applicationpath /Applications/Install\ macOS\ Mojave.app
Notes and common issues:
Go back to Disk Utility, select your newly formatted USB partition from the left panel. Click the button in the top menu bar. create mac os x bootable usb installer from dmg
Below is a comprehensive guide to extracting the necessary installer assets from a DMG file and writing them to a USB drive using both the built-in macOS Terminal and a reliable third-party GUI tool. Prerequisites: What You Need Before Starting sudo /Applications/Install\ macOS\ Mojave