Command for listing android devices: "adb devices".
The first thing to do is activating developer options. To do this, navigate to Settings->About phone and tap "Build number" 7 times. "Developer options" appear above "About phone" in the Settings view. This part is easy.
Then, activate USB debugging. To do this, navigate to Settings->Developer options, and check USB debugging. If you do this without PC Companion is installed in your PC, a driver named D5803 will be shown as not installed. So, install PC Companion.
I don't know why but a search for "PC Companion Sony Z3 Compact" brings irrelevant results. Because of this, search for "sony z3 computer tools". There should be a link to the download site of PC Companion.
Make sure that the phone is connected and in USB debugging mode before opening PC Companion. This will install D5803.
After this point, normally you should be able to see the phone listed as a device, but in my case, there was a not about the device being unauthorized. I closed and opened USB debugging and list the devices again. After this, I could be able to see the device normally.
Here is a nice guide to installing apk files using adb: