Help us understand the problem. What is going on with this article?

iOS Simulatorのシステムログを確認する

More than 3 years have passed since last update.

iOS実機のシステムログはiOS Consoleで簡単に確認できるが、iOS Consoleではシミュレータのログは確認できないらしい。ということでシミュレータのログをターミナルで表示してみる。

まずデバイスコードを調べる。ターミナルで

$ instruments -s devices

を実行する。すると下記のような結果が得られる。

Resizable iPad (8.1 Simulator) [032E0AF3-9943-41BF-BE07-6EBBAD29C292]
Resizable iPad (8.3 Simulator) [89E067A1-E066-4010-A8DA-4AB126321BD3]
Resizable iPhone (8.1 Simulator) [255FC585-6339-4822-A3BD-A4AD7F995353]
Resizable iPhone (8.3 Simulator) [F1925327-7810-4AC4-AB80-2336FE2ECCF9]
iPad 2 (7.1 Simulator) [278E9982-C4B7-403D-8135-F0293732D9B4]
iPad 2 (8.1 Simulator) [8E69F598-598A-48CB-869F-0B3A13D3187A]
iPad 2 (8.3 Simulator) [16678101-7A50-4C4E-912F-37C8598C17B7]
iPad Air (7.1 Simulator) [7EF8022A-2639-46BB-9D5E-DA35D7663F94]
iPad Air (8.1 Simulator) [4B2593CD-AB66-4CC6-B809-23D23F0B0662]
iPad Air (8.3 Simulator) [01FAB7AF-EE51-4030-8B2D-133CC84CB1AB]
iPad Retina (7.1 Simulator) [60B9AE25-9D7B-414D-80F4-84C78F3763B6]
iPad Retina (8.1 Simulator) [D5F24867-8030-4169-8230-CB152307B002]
iPad Retina (8.3 Simulator) [C5C4EA3D-26D1-4352-821F-F6F4F48BCD32]
iPhone 4s (7.1 Simulator) [DFA7624D-DDAA-42AA-9194-2ECDC64F30EE]
iPhone 4s (8.1 Simulator) [076A2837-ABFA-46F6-A73E-39E5BD64AFFE]
iPhone 4s (8.3 Simulator) [FF5F53D8-E26A-49A2-9EFD-CD1307A0CB7E]
iPhone 5 (7.1 Simulator) [8608D11B-795E-4CDF-ACDD-3183902DFA86]
iPhone 5 (8.1 Simulator) [1CB9AA79-0F70-495F-A61F-7373CA8C995C]
iPhone 5 (8.3 Simulator) [8C74777F-2388-4118-BC7C-F5AEBC9D4E55]
iPhone 5s (7.1 Simulator) [ED896B1E-8471-48BC-8841-C1551C2014C1]
iPhone 5s (8.1 Simulator) [D896BBDB-70BD-4270-927A-45F6C79DC28E]
iPhone 5s (8.3 Simulator) [9767F389-F5B1-4B9D-B476-4A5A26B46149]
iPhone 6 (8.1 Simulator) [CF9BE10F-10C9-43D5-8FD1-584A40C1C585]
iPhone 6 (8.3 Simulator) [690BBFDC-F913-46D7-B5C6-54291653076E]
iPhone 6 Plus (8.1 Simulator) [C2D24805-9803-40F5-B67C-62CE907E1D48]
iPhone 6 Plus (8.3 Simulator) [4A625DCE-E996-43E5-88ED-022DB6FC7305]

この場合一番下のiPhone 6 Plus iOS 8.3シミュレータであれば4A625DCE-E996-43E5-88ED-022DB6FC7305が私の環境でのデバイスコードである。

ログファイルのパスは~/Library/Logs/CoreSimulator/<DEVICE_CODE>/system.logである。なのでiPhone 6 Plus iOS 8.3シミュレータであればターミナルで

$ tail -f ~/Library/Logs/CoreSimulator/4A625DCE-E996-43E5-88ED-022DB6FC7305/system.log

と実行することで、ログを確認することができる。デバイスコードは各環境で違うのでそれぞれ置き換えて実行する。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away