Tag Archives: Mac OS X

如何安装魔兽世界国服Mac版

下载官方的Mac版Battle.net应用(国服或者欧服),我目前看到的版本都是1.12.2.2598。完成后安装。安装完运行,点击向下的箭头,选择“中国”/“China”,然后使用战网账号登录。选择“魔兽世界”/“World of Warcraft”,点击“安装”/“Install”,安装完成后,运行就可以了。

Qt 5.5.0 on OS X: fix for ‘-Winconsistent-missing-override’ warning

Qt 5.5.0 officially released on July 1st. But on OS X, for example 10.10.4+Xcode 6.4(clang-602.0.53), you will have lots of warnings about ‘-Winconsistent-missing-override’, like:

Yes, there is a bug report(QTBUG-46833) for it. And the fix is in 7d5e849e.

The solution is:

Go to Line 158, change 6020049 to 7000053. Save it!

OS X下最近浏览器变慢了

之前10.8,最近升级到10.9。浏览器打开网页总是很慢,有的时候觉得好像第一遍总是不能加载,然后刷新一下,还有希望成功,但都很慢,而且不是一个浏览器,Safari/Chrome/Firefox都试过,好像差不多。

打开了Activity Monitor看了看,有个acwebsecagent的进程占用了很多内存。杀掉它之后,浏览器里会好些,但它还是会自动重启的,过一会儿,就又慢了。

Google了一下,发现了这篇文章,Random Slowdown of Browsers in OS X Mountain Lion,原来是我安装的Cisco AnyConnect Secure Mobility Client导致的。重新运行安装程序,确保取消选中“Web Security”,然后就会删掉这个东东了,然后浏览器就正常了。

在这篇博文的回复中,还有一个更简单的方法:

备忘一下。

Distributed Compilation the build of Qt

Qt is a huge project, especially like the module, QtWebKit. If you happen to be in a computer farm, it is very useful to use distributed complation to speed up the build of Qt.

Here I suggest to use icecream on Linux and Mac OS X, and IncrediBuild on Windows(at least for Microsoft’s Visual Studio compilers). About IncrediBuild, more details perhaps will be updated in the future. See also qtrepotools: publish ibmake.bat, incredibuild xge wrapper for make/buildconsole.

Today, this blog is more about icecc/icecream.

Preparation

Linux

icecream is maintained by the SUSE people. Then there are less issues in OpenSUSE than in Ubuntu. But Ubuntu is more popular one. I just use Ubuntu as example here.

  • Install your compiler, like gcc and clang.
  • Install icecc and icemon(optional). icemon is the monitor of icecream build, better to check it when you setup the enviroments. It’s an GUI application based on Qt 4.8. Note: you need to install 0.9.8~git2012121601-0ubuntu2 and later version for icecc. More details in “icecc” package in Ubuntu.

  • For clang users, if you want to make icecream compiler package, better to do:
    • 13.04: $ sudo ln -s /usr/include/clang/3.2/include /usr/lib/clang/3.2/
    • 12.04: $ sudo ln -s /usr/include/clang /usr/lib/
  • Create compiler package: please do it. Here is the example for 13.04:

  • Enviroment settings before build:

  • Run icecc-scheduler in one of your Ubuntus:
    • Edit /etc/default/icecc, set START_ICECC_SCHEDULER="true".
  • Start icecc service: sudo /etc/init.d/icecc start, icecc-scheduler service also could be started with this. Not suggest to run multiple icecc-scheduler in same network with default values, you could edit /etc/icecc/icecc.conf with more options.
  • Stop icecc service(optional): sudo /etc/init.d/icecc stop

Mac OS X

  • Create a ‘qt’ user. Open System Preferences -> Users & Groups -> “+” under the list of users (you might need to click the lock icon first and type in your password), add a user “qt” with your standard password.
  • Install HomeBrew

  • Install XCode and command line tools.
  • Install icecc and icemon(optional).
  • Create compiler package: please do it. Here is the example for 10.8:

  • Enviroment settings before build: (Note: looks like it doesn’t work well with a compiler package. 2013-06-19)

  • Copy com.github.iceccd.plist into into /Library/LaunchDaemons .
  • sudo chown root /Library/LaunchDaemons/com.github.iceccd.plist
  • Start icecc service: sudo launchctl load /Library/LaunchDaemons/com.github.iceccd.plist
  • Stop icecc service(optional): sudo launchctl unload /Library/LaunchDaemons/com.github.iceccd.plist

Building Qt

Normally just do source ~/.icecc_rc, configure and make.

  • For clang build(both Linux and Mac OS X), please keep in mind to use -no-pch when configure.
  • For Qt4 build, the -arch argument that Qt 4 passes to the compiler confuses icecream. So for now, if you use Qt4, you need to patch your mkspec to not add that (if you build for your local architecture only), eg. in mkspecs/common/gcc-base-macx.conf.(Note: looks like it’s only on Mac OS X, I haven’t tried it yet.)

Known Issues

  • Using icecream currently screws up debug information for all object files that we compiled remotely!(Mac OS X only)

Thanks

How to embed an Info.plist into arbitrary binaries

For an application on OS X, the Info.plist file is very common. But could we embed it into the binaries?

Yes, we can. There is a compiler option “–sectcreate __TEXT __info_plist Info.plist”.

One example is the .pro file for qmlplugindump in qtdeclrative, change 4d173d5f16c103f640d4089feed44a74b14e9004.

I learned it from ariya‘s commit in phantomjs: 71425850f61ad85e33741ed5a59364327532f6a8.

And today I read an article: Gimmedebugah: how to embedded a Info.plist into arbitrary binaries, which also mentioned this. And it gives me the Apple documentation for that, Code Signing Tasks: Adding an Info.plist to Single-File Tools.

如何安装魔兽世界国服Mac版

注意:暴雪的中国代理网易那里官方并不支持魔兽世界国服Mac版,本篇文章属于社区贡献的总结。

暴雪大神其实一直是Windows+Mac双平台的,而且暗黑破坏神III都登陆PS3了。至于魔兽世界国服,不知道是当初九城引进时候的问题,还是网易接盘的问题,一直不能是用Mac版。至于国服的星际争霸II和暗黑破坏神III的Mac版的情况,我也不太清楚,好像也都没有吧。

x-only.net的Huan Zuo同学(微博: HZ老师)在这方面工作了很久,一直在他的网站上提供了Mac版的支持。在此,向他致敬。

我自己最近是从5.1开始,从Windows下切换到Mac的。

我这里主要是简述一下他的工作。

方法一:下载解压升级

下载:(1-10每个文件2G,11大约91M。下表还提供了sha1sum。)

解压:

我这里用的是The Unarchiver解压的。

升级:

直接点击运行World of Warcraft Launcher就可以了,等一会儿,就可以升级到5.3.16992。

方法二:Windows版修改

在Windows下升级至最新版5.3.16992,然后将整个文件夹复制到Mac下。(Mac可以直接读取NTFS分区的) (备注:Windows版的客户端请保留好,相当于备份。)

下载这个文件,大约84.2M,sha1sum为067a0d9c321462a99842ddc980d7777306a87088。

下载完成后,打开这个.dmg文件,会出现一组文件,全部复制粘贴到上述的Windows客户端的文件夹内,会提示有几个文件是否覆盖,回答是的。

直接点击运行World of Warcraft Launcher就可以了,等一会儿,就可以正常使用了。

参考链接:

备注:

Memo: Mac OS X Internals

Recently just started to read a few pages in this book, Mac OS X Internals: A Systems Approach, by Amit Singh. It’s a bit old, too much contents about the old PPC.

Then yesterday found an interesting video about same topic, YouTube: Inside the Mac OS X Kernel [24c3]. (Note: some people can’t access it.) This video was public recently, but it’s also a bit old, Dec. 2007. It’s from 24th Chaos Communication Congress: Inside the Mac OS X Kernel, by lucy. (You can find the slides there.)

请点击查看视频

And I am not sure whether one sentence in the presentation is still correct or not now, “The Mac OS X kernel is not 64 bit.”

Last night, I was back to 1998

Hi, friend, it’s a “title party” blog. The original word is 标题党, and “title party” was translated from Google Translate. I really don’t think 标题党 is “forum spammer” here.

Back to my blog, it’s about running Caesar III on my MacBook Air 2012 13″ via CrossOver.

Caesar III is one of my faviourite games during university. (Sorry, I used a crached version at that time. And it’s still in one of my hard disks, just haven’t played it for years.)

I tried Caesar IV several years ago, but I don’t like the 3D in that game.

Caesar III only has windows version.

Last week, I got a deal, CodeWeavers: Flock The Vote: 2012, a free CrossOver for Mac and Linux.

First application which I want to run, Caesar III, popped up in my mind. Googled “CrossOver Caesar III” and got this page WHAT RUNS: Caesar III, looks like it’s possbile. Then I found some people is using GOG version.

What’s GOG? Good Old Games

It’s only $5.99 and digital downloadable version! I bought it.

But I can’t run it successfully at the first time. The display is garbled after running it. But sound is ok, and ESC could trigger the Quit dialog, the dialog works.

I gave up at that night. And posted a thread in forum.

After checking my thread for days, didn’t get any reply.

Last night, got some spare time after my daughter went to sleep. I found an irc channel for CrossOver, irc.freenode.net/#crossover .

Haha, got some suggestions from Axylus.

Remove the current installed CrossOver and Caesar III:

Then install CrossOver, and Caesar III(use Windows98 bottle).

Before running the game, Configure->Manage Bottles, select “setup_caesar_3.exe” in left, and choose “Control Panel” in right, choose “Wine Configuration”, and click “Launch Selected Item”. In “Graphics” tab, check “Emulate a virtual desktop”, Desktop size could be 800×600 and 1024×768, but for 1024×768, you should also enter the game to set it in Options->Display Settings.

It works this time! (though it’s not in full-screen mode.)

I was back to 1998!

Some other tips for CrossOver:

Windows VNC Viewer connecting to Mac OS X Lion

I have a Mac Mini as a Home Theater PC, which is running Mac OS X Lion. And I also have a laptop with Window 7 Home Basic SP1.

I have tried to use Real VNC Viewer to connect to my Mac Mini before, but failed.

Today I tried again, by searching from web and found there is a solution now.

On Lion,

1. System Preferences->Users & Groups->Login Options, set “Automatic Login” to off.
2. System Preferences->Sharing, turn on “Screen Shareing” and click on “Computer Settings” button, set a password for “VNC Viewers may control screen with password:”.

On Windows,

1. Try to download “Ultra VNC Free Viewer“.

Then it will work for you. Many people said “Tight VNC Free Viewer” and “Real VNC Free Viewer” do not work well as the Ultra one.

Reference:
Apple Support Communities: TightVNC (or other windows VNC viewer) connecting to OS LION

How to run autotests in Qt for Symbian on Linux and Mac?

Here is the official article for it, Installing Qt for the Symbian platform using Linux (experimental).

The basic idea is same on Linux and Mac OS X.

1. For phone, you need to install Application TRK

S60 5.0/Symbian^1 – s60_5_0_app_trk_3_2_7.sisx
Symbian^3 – s60_tb_9_2_app_trk_3_2_8.sisx

2. Use usb cable to connect your phone and computer, Linux or Mac OS X. Remember to set to “PC Suite” mode or “Nokia Ovi Suite” mode on your phone. Then launch your Application TRK via “RnD Tools”->”TRK”.

3. About the device name for your phone on computer

For Linux, see more details in Configuring the USB Serial Driver on the Linux System. After that, you will find /dev/ttyUSBx and maybe another /dev/ttyUSBy, better to “sudo chmod 777 /dev/ttyUSB*” for them(some Linux distribution do not give the access to normal users for it, like Ubuntu).

For Mac, you could find sth like /dev/cu.usbmodemfaXx and /dev/cu.usbmodemfaXy.

4. To build runonphone, you need to have libusb installed.

For Linux, just follow that documentation, “sudo apt-get install libusb-dev” should be ok for Debian/Ubuntu.

For Mac, “sudo brew install libusb-compat” works for me.

5. Build runonphone, use the qmake in your desktop Qt.

cd ~/qt/qt/tools/runonphone
/usr/bin/qmake
make

6. Build and run your autotests, please check previous blog for the EPOCROOT and PATH environments settings.

cd qt/qt/tests/auto/qdatetime
~/build/s3_gcce/bin/qmake -spec ~/qt/qt/mkspecs/symbian-gcce -o Makefile ~/qt/qt/tests/auto/qdatetime/qdatetime.pro
make sis
~/qt/qt/tools/runonphone/runonphone -p /dev/cu.usbmodemfa44 –sis ~/qt/qt/tests/auto/qdatetime/qdatetime.sis qdatetime.exe

NOTE: Here the /dev/cu.usbmodemfa44 is the device on Mac for me. And for Linux, the device is sth like /dev/ttyUSB1.

Enjoy it!