generatetoaddress nblocks "address" ( maxtries )
Mine blocks immediately to a specified address (before the RPC call returns)
Type: numeric, required
How many blocks are generated immediately.
Type: string, required
The address to send the newly generated bitcoin to.
Type: numeric, optional, default=1000000
How many iterations to try.
[ (json array) hashes of blocks generated
"hex", (string) blockhash
...
]
Generate 11 blocks to myaddress:
bitcoin-cli generatetoaddress 11 "myaddress"
If you are using the Bitcoin Core wallet, you can get a new address to send the newly generated bitcoin to with::
bitcoin-cli getnewaddress