引用第4楼shiziyang于2011-04-07 14:44发表的 :
macdeployqt X.app/ -verbose -dmg
带dmg可以直接给出dmg镜像,不带就只把app包打出来,具体请看该命令的帮助。
如果程序用到非qt的第三方库,使用前先把这些库放到系统默认搜索路径下,如/usr/lib等

我用qt creator编译release版本后,输入命令后出现了很多警告和错误?不清楚这是什么意思?我也是在虚拟机下开发,但是在真实的Mac机上测试生成的dmg只是一闪而过,报错。
localhost:testSysinfo-build-desktop ljie$ macdeployqt testSysinfo.app/ -verbose=1 -dmg
WARNING:
WARNING: Could not find any external Qt frameworks to deploy in "testSysinfo.app"
WARNING: Perhaps macdeployqt was already used on "testSysinfo.app" ?
WARNING: If so, you will need to rebuild "testSysinfo.app" before trying again.
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/accessible/libqtaccessiblewidgets.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/accessible/libqtaccessiblewidgets.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/bearer/libqgenericbearer.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/bearer/libqgenericbearer.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/bearer/libqnmbearer.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/bearer/libqnmbearer.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/codecs/libqcncodecs.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/codecs/libqcncodecs.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/codecs/libqjpcodecs.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/codecs/libqjpcodecs.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/codecs/libqkrcodecs.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/codecs/libqkrcodecs.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/codecs/libqtwcodecs.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/codecs/libqtwcodecs.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/graphicssystems/libqtracegraphicssystem.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/graphicssystems/libqtracegraphicssystem.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/imageformats/libqgif.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/imageformats/libqgif.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/imageformats/libqico.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/imageformats/libqico.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/imageformats/libqjpeg.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/imageformats/libqjpeg.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/imageformats/libqmng.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/imageformats/libqmng.dylib"
ERROR: file copy failed from "/Developer/Applications/Qt/plugins/imageformats/libqtiff.dylib"
ERROR: to "testSysinfo.app/Contents/PlugIns/imageformats/libqtiff.dylib"
WARNING:
WARNING: "testSysinfo.app/Contents/Resources/qt.conf" already exists, will not overwrite.
WARNING: To make sure the plugins are loaded from the correct location,
WARNING: please make sure qt.conf contains the following lines:
WARNING: [Paths]
WARNING: Plugins = PlugIns
localhost:testSysinfo-build-desktop ljie$