RIGHT:[[Mac 関係覚え書き]] *コマンドラインツールのインストール [#zb268d83] AppStore から Xcode をインストールした後 $ xcode-select --install *Xcode のデバッガに関する権限 [#z17bfe87] Xcode Tools でデバッガや iPhone SDK の iPhone シミュレータを動かすと, 管理者のパスワードを問い合わせるダイアログが表示される. 対応方法としては,実行するユーザやそのユーザが所属しているグループを _developer グループ に所属させてやる必要がある. 例) student グループを _developer グループに入れる sudo dseditgroup -o edit -a student -t group _developer さらに Xcode4 からは次のコマンドを打っておく(Enable Developer Mode という問い合わせに[Enable] とすると管理者パスワードを聞かれるので...) sudo /usr/sbin/DevToolsSecurity -enable 参考URL http://superuser.com/questions/439482/automatically-enable-xcode-developer-mode-on-computer-lab-workstations ---- *Xcode 4.2 for Snow Leopard [#y7b7e86f] 以前(2011年10月ごろ)は,AppStore で購入できたと記憶しているが, 今(2011/11/17)に見てみると for Lion しかない. Lion 版はインストールできないようだし. アップルに問い合わせると,Lion 版をフリーで公開したのに伴い, Snow Leopard 版は購入できないようにしたとのこと. Snow Leopard まだまだ現役なのになぁ. あ, http://developer.apple.com/support/xcode/ によると >>Both Xcode 3 and Xcode 4 include the most recent SDKs for both Mac OS X and iOS. ってことなので,SDK は同じバージョンなのかな. ---- *Xcode 4(MT Lion) [#lcc4cf62] App Store に Apple ID でログインしてダウンロード 一度実行する System Component Installation 画面にて 「Device Support」 インストール Xcode 4 を起動 [Preferences]->[Downloads] で [Command Line Tools] をインストール コマンドラインツールもインストールする また,デバッガやシミュレータを動かすと管理者パスワードを 問われるので,以下のコマンドによりユーザを _developer グループ に所属させてやる. Xcode 4 からはさらに,build や run を実行した際に, 「Enable Developer Mode?」と聞かれ,[Enable]とすると 管理者パスワードを聞かれるので,1行めのコマンドを実施する. $ sudo /usr/sbin/DevToolsSecurity -enable (上記のコマンドは Mac ごとにやってやる必要がある.マスター配布などをやっている場合には配布後に実行する) $ sudo dseditgroup -o edit -a <所属グループ名> -t group _developer ---- *Xcode 5(Mavericks) [#u76987cb] App Store に Apple ID でログインしてダウンロード 一度実行する System Component Installation 画面にて 「Device Support」 インストール Xcode を起動 また,デバッガやシミュレータを動かすと管理者パスワードを 問われるので,以下のコマンドによりユーザを _developer グループ に所属させてやる. さらに,build や run を実行した際に, 「Enable Developer Mode?」と聞かれ,[Enable]とすると 管理者パスワードを聞かれるので,1行めのコマンドを実施する. $ sudo /usr/sbin/DevToolsSecurity -enable $ sudo dseditgroup -o edit -a <所属グループ名> -t group _developer これらのグループは,ローカルのディレクトリに同じ名前,GID で 追加してやる必要があった.(Mavericks では) なので, $ sudo dseditgroup -o edit -a everyone -t group _developer をしておけば,確実(セキュリティ的にはどうかというのがあるが) さらに, ~/Library/Application Support/iPhone Simulator がネットワーク上にあると iPhone シミュレータが正常に起動しない. そのため, su $1 -c "test -L ${HOME}/Library/'Application Support'/'iPhone Simulator'" if [ $? -ne 0 ] then su $1 -c "rm -rf ${HOME}/Library/'Application Support'/'iPhone Simulator'" su $1 -c "mkdir -p /Work/.$1/iPhoneSimulator" su $1 -c "ln -s /Work/.$1/iPhoneSimulator ${HOME}/Library/'Application Support'/'iPhone Simulator'" fi といった形でローカルドライブ上にシンボリックリンクを張ってやる必要がある. ---- *Xcode 6(Yosemite) [#fdccb177] Xcode 5 での権限設定は同様. iOS Simulator のファイル構成が異なる ~/Library/Developer/CoreSimulator がネットワーク上にあると iOS シミュレータが正常に起動しない. そのため, su $1 -c "test -L ${HOME}/Library/Developer/CoreSimulator" if [ $? -ne 0 ] then su $1 -c "rm -rf ${HOME}/Library/Developer/CoreSimulator'" su $1 -c "mkdir -p /Work/.$1/CoreSimulator" su $1 -c "ln -s /Work/.$1/CoreSimulator ${HOME}/Library/Developer/CoreSimulator" fi といった形でローカルドライブ上にシンボリックリンクを張ってやる必要がある. ---- *ライセンス同意 [#o14000ee] 未確認 # /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -license accept ---- *Xcode 7.2.1 [#z5c5a9fc] 起動するたびに Mac のディスクイメージをクローニングすると, 各ユーザの最初の Xcode 起動時に "Install additional required components?" と問われて,管理者パスワードを入力しないと Xcode を起動できない. どうも Xcode 7.2.1 だけの問題. 以下の対応でいける?(未確認) 以下の対応でいけるようだ. sudo defaults write /Library/Preferences/com.apple.dt.Xcode DVTSkipMobileDeviceFrameworkVersionChecking -bool true 個人ごとなら defaults write com.apple.dt.Xcode DVTSkipMobileDeviceFrameworkVersionChecking -bool true