# Can't open p5.js sketch on mobile which works on mac

**URL:** <https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557>\
**Category:** p5.js\
**Created:** [May 6, 2020, 6:13pm UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557 "2020-05-06T18:13:02Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![lohoso](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lohoso/32/9097_2.png) [@lohoso](https://discourse.processing.org/u/lohoso)\
**Post date:** [May 6, 2020, 6:13pm UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557/1 "2020-05-06T18:13:02Z")

</div>

[https://editor.p5js.org/lohoso/present/Td-myBfmT](https://editor.p5js.org/lohoso/present/Td-myBfmT)

The sketch works on laptop, but does not work on my iPhone.

Anyone can help?

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 6, 2020, 9:45pm UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557/2 "2020-05-06T21:45:58Z")

</div>

It works on my iPhone SE running Safari on iOS 13. What model, version and browser are you on?

---

<div class="post-metadata">

**Author:** ![lohoso](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lohoso/32/9097_2.png) [@lohoso](https://discourse.processing.org/u/lohoso)\
**Post date:** [May 7, 2020, 6:58am UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557/3 "2020-05-07T06:58:04Z")

</div>

I use iPhone XS max, iOS 13.3.1. I tried Safari & Chrome on it, but both fail.

And I try to open it on an android phone, the sketch works.

---

<div class="post-metadata">

**Author:** ![Sven](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/sven/32/8293_2.png) [@Sven](https://discourse.processing.org/u/Sven)\
**Post date:** [May 7, 2020, 7:59am UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557/4 "2020-05-07T07:59:41Z")

</div>

The canvas in your sketch is pretty large (2000×968 px). Maybe you’re hitting the [maximum canvas size](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#Maximum_canvas_size) for your specific device. Try making the canvas a lot smaller, like 300×300 px.

To know for sure what’s happening you should hook up your iPhone to your Mac and [use the Web Inspector to debug the problem](https://www.kenst.com/2019/03/how-to-debug-problems-on-mobile-safari/).

---

<div class="post-metadata">

**Author:** ![lohoso](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/lohoso/32/9097_2.png) [@lohoso](https://discourse.processing.org/u/lohoso)\
**Post date:** [May 7, 2020, 9:27am UTC](https://discourse.processing.org/t/cant-open-p5-js-sketch-on-mobile-which-works-on-mac/20557/5 "2020-05-07T09:27:52Z")

</div>

I changed size of canvas, it works on my iPhone! Thanks a lot!
