I tried to restore all my HD address by importing my xprv in new wallet file but it only shows 20 addresses. How can I make it show all the child addresses of my xprv?
Is not feasible to show all possible addresses, there are just too many. However you can change the gap limit.
By default, Electrum shows the first 20 private keys.
You can change that by going to console tab (view menu > show console) and typing in this:
The above will increase the number of unused addresses past the index of the last used address to 200 i.e. this becomes the new Electrum lookahead window.
If you want to generate change addresses instead you can do the following:
for thing in range(1,200): wallet.create_new_address(True)