As of Xcode 10, here is how to turn off code signing for a macOS app:
- Select your project in the project navigator.
- Select your app in the list of targets.
- Click “Build Settings”.
- Click “All”.
- Click “Levels”.
- Type “identity” into the search field.

- Click on the Code Signing Identity row, under the column for your app target (labeled “test” in my example). That cell of the table might appear empty.

- In the pop-up menu that appears, choose “Other…”.

- In the popover text box that appears, delete all text so the box is empty.

- Press return to dismiss the popover.
With this setting, Xcode will not sign your app target.