LoginSignup
0
2

More than 5 years have passed since last update.

Mac で開発中のサイト(localhost)を iPhone で表示させる

Last updated at Posted at 2019-02-03

http://localhost:3000
というような今開発しているローカルサイトを手元にある iPhone ですぐに見られるようにします。
基本方針は Bluetooth を使ったインターネット共有で、ハード・ソフト面で他に何も準備しないバージョン。
https の対応はまた今度。

環境

  • MBP
    • Wifi でインターネット接続
  • iPhone
    • 特別な設定なし
  • 有線 LAN なし
  • ケーブル類出したくない

方法

1: システム設定 -> 共有 を開きます

Screen Shot 2019-02-03 at 21.28.56.png

2: インターネット共有を設定します

Screen Shot 2019-02-03 at 21.34.13.png

右側の Bluetooth を選んで左側のインターネット共有をオン。
上の下線を引いてある (pcの名前).local をメモ。

3: iPhone から Bluetooth で Mac に接続

4: iPhone のブラウザを開いてアドレス欄に http://(pcの名前).local を入力してアクセス

http://localhost:3000 で開発しているなら http://(pcの名前).local:3000 を入力。

5: 見れます

備考

  • Mac の Wifi が余ってるなら Bluetooth じゃなくてそっちで繋げられます
  • というか同じ Wifi 繋げるなら IP 直接打てばいいみたいなところもあります
    • 同じネットワークに繋げない特殊環境で役立ててください
0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2