Top Banner
Macにプログラミング環境を構築する for 情報理工学部1回生
29

Programming on Mac

Dec 18, 2014

Download

Education

Fumitaka Yamane

 
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Programming on Mac

Macにプログラミング環境を構築するfor 情報理工学部1回生

Page 2: Programming on Mac

目次

• Xcode

• Emacs

• RitsPen

• その他

• 資料

Page 3: Programming on Mac

Xcode

Page 4: Programming on Mac

Xcodeとは• Mac OS X / iOS 向け開発環境

• Xcodeをインストールすると,gccが付いてくる

• Xcode 3と Xcode 4がある

• Xcode 4は有料(600円)

• Xcode 3は無料だが,Apple Develperの登録が必要

• Mac OS XのインストールディスクにXcodeが付属している場合は,登録不要

Page 5: Programming on Mac

インストール手順• Xcode 4

• Mac App Store からXcodeを購入

• Install Xcode を実行

• Xcode 3

• Apple Developer 登録

• ダウンロード

• インストール

Page 6: Programming on Mac

Apple Developer 登録

• http://developer.apple.com/jp/programs/register/

Page 7: Programming on Mac

Apple Developer 登録

iTunes等ですでにApple IDを作っていても,新しく作った方が良い.(英語で登録する必要があるため)

1. Apple ID

Page 8: Programming on Mac

Apple Developer 登録

つづく

注意:すべて半角英数で入力する.

2. 個人情報の登録

Page 9: Programming on Mac

Apple Developer 登録

日本の国番号は81.例えば,090-xxxx-yyyyなら最初の0を抜いて「81 90 xxxx yyyy」

Page 10: Programming on Mac

Apple Developer 登録3. 開発したいものの種類等

適当に選択し,Continueをクリック

Page 11: Programming on Mac

Apple Developer 登録4. 規約

チェックして規約に同意

Page 12: Programming on Mac

Apple Developer 登録5. メールアドレスの確認

送られてきたメールのcodeをクリック

Page 13: Programming on Mac

Apple Developer 登録完了!

Page 14: Programming on Mac

ダウンロード

• http://developer.apple.com/devcenter/mac/index.action

クリックしてダウンロード

Page 15: Programming on Mac

インストール• ダウンロードした

dmgファイルを開く

• Xcode and iOS SDK.mpkg をダブルクリック

• インストーラの指示に従ってインストール

Page 16: Programming on Mac

確認• ターミナルを開く

• アプリケーション→ユーティリティ →ターミナル

• which gcc と入力してenterキーを押す

• 「/usr/bin/gcc」と表示されればOK

Page 17: Programming on Mac

Emacs

Page 18: Programming on Mac

Carbon Emacs パッケージ• Mac OS X のウィンドウ環境で動作する GNU Emacs のバイナリパッケージ

• 特徴

• インストールが簡単

• あらかじめ設定されていて便利

• Macで使うのに便利な機能が追加されている

• RAINBOW環境のemacsよりひとつ古いバージョン(使用上,問題は無い)

Page 19: Programming on Mac

ダウンロード

• http://homepage.mac.com/zenitani/emacs-j.html

クリックしてダウンロード

Page 20: Programming on Mac

インストール

ドラッグしてApplicationsフォルダに入れる

Page 21: Programming on Mac

他のインストール方法• こだわりのある人へ

• 自分で全部設定したい人

• emacs23を使いたい人

• フルスクリーン機能が欲しい人

• GNU Emacs for Mac OS X

• http://emacsformacosx.com/

• Aquamacs

• http://aquamacs.org/

• Macports / Homebrew でインストール

• sudo port install emacs-app + fullscreen

• brew install emacs --cocoa

• ソースからビルド

Page 22: Programming on Mac

設定方法• M-x customize

• 右図のようなメニュー画面で設定できる

• 設定情報は,~/.emacsに保存される

• .emacs を編集する

• 直接.emacsを編集してもよい

• .emacsはelispというプログラミング言語で記述されている

Page 23: Programming on Mac

RitsPen

Page 24: Programming on Mac

その他

Page 25: Programming on Mac

Macports• Macportsとは

• Mac OS X 上で利用可能なパッケージ管理システム

• 主に UNIX 向けに開発されたオープンソース・ソフトウェアを手軽にインストール,更新,削除することができる

• 類似品

• homeberw, fink, gentoo_prefix など

Page 26: Programming on Mac

Macportsのインストール• ダウンロードしてインストール

• http://www.macports.org/install.php

• 環境変数PATHの設定

• もしホームディレクトリに「.bash_profile」が生成されていなかったら,以下の内容で作成する

• export PATH=/opt/local/bin:/opt/local/sbin:$PATH

• 更新

• sudo port selfupdate

Page 27: Programming on Mac

openコマンド• 便利

• open <ファイル>

• ファイルをダブルクリックするような効果

• 例:open test.txt    →test.txtをテキストエディットで開く

• 例:open /Application →アプリケーションフォルダをFinderで開く

• open -a <アプリケーション>

• アプリケーションを起動

• 例:open -a Safari

• open -a <アプリケーション> <ファイル>

• アプリケーションでファイルを開く

• 例:open -a Emacs test.c

• 詳細は man open で調べましょう

Page 28: Programming on Mac

資料• [Mac]

• Apple公式チュートリアル「Macを使いこなそう」

• http://www.apple.com/jp/findouthow/mac/

• Mac Wiki

• http://macwiki.sourceforge.jp/wiki/

• [Xcode]• Apple developerに登録、Xcode3(無料)をダウンロード/インストール  ~iPad 2でマルチ

タスク用ジェスチャーが使いたーい〈下準備編〉~ : もっと知りたいリンゴあれこれ

• http://yucomac.blog96.fc2.com/blog-entry-341.html

• [MacPorts]• MacWiki - MacPorts

• http://macwiki.sourceforge.jp/wiki/index.php/MacPorts

Page 29: Programming on Mac

資料• [Emacs]

• 「Emacsテクニックバイブル」

• http://gihyo.jp/book/2010/978-4-7741-4327-9

• Web+DB Press vol.58 特集2「思考を直感的にコード化し,開発を加速する

Emacs活用∞(無限大)」

• http://gihyo.jp/magazine/wdpress/archive/2010/vol58

• Emacs Wiki

• http://www.emacswiki.org/emacs-ja

• Emacs23 (Cocoa Emacs) 入門から中毒まで : 紹介マニア

• http://sakito.jp/emacs/emacs23.html