The following should work on LyX >= 2.3.1 for all operating systems:
First go to Tools > Preferences > Output and change "Overwrite on export" to "All files". Make sure you know what that means and that you are comfortable with that.
Apply that preference change.
Then go to Help > About to find out where your "Library directory" and "User directory" are. For example, mine are
library directory: /usr/share/lyx
and
user directory: ~/.lyx/
Navigate (e.g. in your file browser) to your library directory and go to the ui folder and copy stdtoolbars.inc to the ui folder of your user directory. So in my case I copied /usr/share/lyx/ui/stdtoolbars.inc to ~/.lyx/ui/stdtoolbars.inc
Now edit stdtoolbars.inc in your user directory:
You want to edit the line below
Toolbar "view/update" "View/Update"
Change
Item "View" "buffer-view"
to
Item "View" "command-sequence buffer-view pdf2; buffer-export pdf2"
If you want to know more, read the LyX help guides in the Help menu for more customization.
command-sequence buffer-view; buffer-export pdf2and press return. – scottkosty Sep 13 '12 at 16:18command-sequence buffer-export pdf2; buffer-view– scottkosty Sep 13 '12 at 19:25gdb. Also note that any fix for this crash wouldn't be released for a few months. – scottkosty Sep 14 '12 at 15:24command-sequence buffer-view pdf2 ; buffer-export pdf2 ;It works for me without crash (Lyx 2.1.4, Mac El Capitan) – T_T Aug 26 '16 at 07:13