0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

chrome headlessで簡単にスマホ画面のキャンプチャを撮る方法(mac)

Posted at

ターミナルで実行します
chromeがインストールされている前提です

エイリアス設定:
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

以下を実行する:
chrome --headless=new --disable-gpu --screenshot=[画像を保存するパス]/[画像名].jpg --window-size=480,2732 --user-agent="Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1" '[ページURL]'

解説:
chrome >> エリリアスで設定。設定後単体で叩いて、chromeが起動したらOK
--headless=new >> headlessモードで起動するよ
--disable-gpu >> なんだっけ...
--screenshot >> 画像を保存するパスと画像名
--window-size >> 画像サイズの横と縦
--user-agent >> iphone safariのユーザエージェント
[ページURL] >> 最後にスクショを撮りたいURLを

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?