If you can use a monitor for the initial setup, then the easiest way is to open the Raspberry Pi configuration tool, in the main menu, under Preferences.
I'm attempting to connect an Android Phone to a Raspberry Pi over WiFi Direct however when the Pi is the group owner (GO) it always fails to form a group.