เปิด WebInspector debugger window ใน Safari

แสดงเมนู Develop ใน Safari

  1. เลือกเมนู Safari > Preferences …
  2. เลือกแท็บ Advanced
  3. คลิกที่ Show Developer menu in menu bar ที่ด้านล่าง
  4. Safari จะแสดงเมนู Develop ขึ้นมา

ใช้งาน WebInspector

  1. ออกจาก iOS Simulator > Quit iOS Simulator. (Important)
  2. Re-launch the iOS Simulator. (This can usually be done from the Apple menu > Recent Items)
  3. Open your webpage or web app in the iOS Simulator.
  4. In Safari, select Develop > iOS Simulator > yourpage.html

ก่อนทดสอบกับโปรเจ็กส์ของ ionic ให้ quiz ตัว iOS Simulator ก่อน (จุดดำๆใต้ icon จะหายไป หรือหายไปทั้ง icon เลย) ไม่งั้นจะไม่เห็น เมนู Develop > Simulator – iPhoneX

จากนั้นค่อยรัน ionic ด้วยคำสั่ง

[code]
$ ionic cordova emulate ios
[/code]

แล้วรอสักพักจนกว่า ตัว iOS Simulator จะขึ้นมา
จากนั้นที่ Safari ให้ไปเมนู Develop > Simulator – iPhoneX ดังรูป

จะเห็นหน้า debug ต่างๆ รวมถึง console ด้วย
แต่ถ้าไม่เห็น console ให้คลิกเครื่องหมายบวกที่มุมบนขวาของ safari แล้วเลือก console

Link