Apple M1 Development Quick-start

  • Command Line Tools
1
2
3
==> Downloading and installing Homebrew...
xcrun: error: unable to load libxcrun (dlopen(/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib, 0x0005): could not use '/Library/Developer/CommandLineTools/usr/lib/libxcrun.dylib' because it is not a compatible arch).
Failed during: git init -q

To get rid of the initial git error, install a complete version of Command Line Tools from Apple Developer site.

Validate Command Line Tools:

sudo xcode-select -p

  • Homebrew

/bin/bash -c “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

  • Curl & wget

brew install curl wget

If you need to have curl first in your PATH, run:

echo ‘export PATH=”/opt/homebrew/opt/curl/bin:$PATH”‘ >> ~/.zshrc

For compilers to find curl you may need to set:

export LDFLAGS=”-L/opt/homebrew/opt/curl/lib”
export CPPFLAGS=”-I/opt/homebrew/opt/curl/include”

  • Oh-my-zsh

Extend the default zsh shell with rich sources of plugins and themes.

  • NVM

You should create NVM’s working directory if it doesn’t exist:

mkdir ~/.nvm

Add the following to ~/.zshrc or your desired shell
configuration file:

1
2
3
export NVM_DIR="$HOME/.nvm"
[ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm
[ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion

Visual Studio for Mac offline installation

Note that the recent release is no longer a preview version.

When trying out the Visual Studio Mac downloader from Microsoft, you will find it with “network error” and not pushing forward anymore.

However, disconnect the network and it will give in, providing with offline downloading links.

It was not possible to complete an automatic installation. This might be due to a problem with your network, proxy servers or an unsolvable installation conflict. At this point, you can continue the installation by manually downloading and installing the independent pieces. The list below shows each component that you need to install.

Mono Framework

Download the Mono Framework v5.0.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

Android SDK

Download the Android SDK for Mac OS X version 24.4.1, open the downloaded archive and copy the contents of the folder found at its root directory (most probably named android-sdk-macosx) to the /Users/semprathlon/Library/Developer/Xamarin/android-sdk-macosx directory.

Click here in order to start the Android SDK Manager application. In the GUI make sure the following components are installed or selected for installation:

  • Android SDK Tools
  • Android SDK Platform-tools
  • Android SDK Build-tools
  • Android API 15
  • Android API 19
  • Android API 21

Once all the required components are selected (you can select others as well, if you wish) start the installation.
If you cannot see /Users/semprathlon/Library/Developer/Xamarin/android-sdk-macosx in Finder please click here to reveal the directory in Finder.

Download the Android NDK for Mac OS X version r10e, open the downloaded archive and copy the contents of its root directory (most probably named android-ndk-r10e) to the /Users/semprathlon/Library/Developer/Xamarin/android-ndk directory.

When the Android SDK installation is finished you might want to start the Android Emulator Manager and create as many emulator images as you might need for your development. This step can be performed at any time, on an as-needed basis.

Visual Studio

Download the Visual Studio v7.0.0 archive to any directory on your disk, double-click it and then drag and drop the Visual Studio icon to the Applications folder.

Xamarin.Android

Download the Xamarin.Android v7.3.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

Xamarin.iOS

Download the Xamarin.iOS v10.10.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

Xamarin.Mac

Download the Xamarin.Mac v3.4.0 archive to any directory on your disk, double-click it and follow the instructions on screen. Please accept all the defaults during the installation, including the target drive.

黑苹果折腾第四迭代之末

暑期,在远景论坛作过大海捞针式的探索追踪,得到了至关重要线索:
OS X 10.10(推测)及其以后的版本中,动态内核加载,使得黑苹果变得不稳定、易无缘无故地死机乃至崩溃。

在clover中启用参数关闭此特性,似乎归于平静了。

又尝试升级到10.11.6,变化不明显。

毕竟macOS Sierra已经发布,下一迭代将用台式机来迎接。

黑苹果折腾第三迭代之末

通过不断调换SSDT存档,得出调查结论:
不同于以往的OS X 10.9,现在无论是BIOS还是DSDT或是SSDT屏蔽独显,都会导致核显工作不正常(闪烁、花屏乃至死机)。
独显虽无法参与工作,但也未必是个累赘。
反倒是**sensors.kext系列让机器温度偏高。
睡眠、唤醒顺利,但是蓝牙还是容易停止工作。
USB3.0能轻松驱动。

黑苹果开机慢的解决

黑苹果开机慢的解决

process launchctl[2] thread 242 caught burning CPU! It used more than 50% CPU…

Uninstalling the current Wacom drivers (6.3.15-1) and installing the previous version (6.3.11-3a)

Speedstep

Screen Shot 2015-12-22 at 20.05.48
Speedstep变频的生效,让CPU能耗稳步地下调。

黑苹果OS X 10 11 2 驱动基本成功:无休止地挂载、重启换来的回报

此前通过折腾OSX10.9获得了一份较可靠的DSDT代码,但是在装10.11期间试过HP Install Helpler所增补的一些不知其所以然的补丁。
两个版本各有优劣,互不相容。

僵持了一个多月后,最终决定手动模拟“二分查找”来对两份代码进行merge操作。

DiffMerge.app是一款直观便捷的文本比较器(不是编辑器)。

经查,防止Clover引导El Captain分区引导失败和排除关机不断电故障的关键代码如下:

OperationRegion (GNVS, SystemMemory, 0xAC5EEB98, 0x019F)

在搜索解答的过程中还发现了有用的资料库:Clover Wiki

为调试DSDT代码,不辞辛劳地降级、升级,方才发现OSX不同版本驱动USB的方式有明显差别。

pcbeta论坛上某坛友仿冒的AppleHDA.kext虽有扬声器音量控制不同步的bug,但总体上异常完善,填补了该领域的一大空白,且能“向上”兼容。

2015年12月勤奋刻苦的国外开发者RehabMan所编写的GenericUSBXHCI.kext成为了驱动USB3.0端口,以及实现USB端口通信正常化的制胜关键。感激不尽。

注意去除DSDT中所注入的USB fakeID之类的值。

OS X 下个性化开发环境的搭建

本人的几轮开发环境配置都是在凌乱中完成的,是时候做一整理了。

  • 安装iTerm2
    没什么话好多说。这个终端应用棒棒的,尤其是卷帘般的可随时唤出的Hotkey Window。别忘了Make iTerm2 default Term
    Screen Shot 2015-11-03 at 22.54.31

  • Homebrew
    Homebrew installs the stuff you need that Apple didn’t.

ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

A package manager with a handy command brew install that works just like apt-get install in Linux.

Snip20151024_2
Snip20151024_4

Read more