# Automatic screenshots of your App for App Store / Play Store

**URL:** <https://forum.ionicframework.com/t/automatic-screenshots-of-your-app-for-app-store-play-store/130265>\
**Category:** ionic-v3\
**Created:** [May 11, 2018, 10:31am UTC](https://forum.ionicframework.com/t/automatic-screenshots-of-your-app-for-app-store-play-store/130265 "2018-05-11T10:31:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mysecondworld](https://avatars.discourse-cdn.com/v4/letter/m/c37758/32.png) [@mysecondworld](https://forum.ionicframework.com/u/mysecondworld)\
**Post date:** [May 11, 2018, 10:31am UTC](https://forum.ionicframework.com/t/automatic-screenshots-of-your-app-for-app-store-play-store/130265/1 "2018-05-11T10:31:30Z")

</div>

I couldn’t believe I have to do screenshots manual. So i did some research.  
This is the best way i found. And its free! 😃

I think the script is self-explaining. The inspiration is from: [https://coligo.io/webpage-screenshots-headless-chrome-node/](https://coligo.io/webpage-screenshots-headless-chrome-node/)

It works with: [https://github.com/GoogleChrome/puppeteer](https://github.com/GoogleChrome/puppeteer)

```auto
const puppeteer = require('puppeteer');
const devices = require('puppeteer/DeviceDescriptors');
const sleep = require('util').promisify(setTimeout);
const emulate = false;
const tablet = 7;

const captureScreenshots = async () => {

    let devicesToEmulate = [];
    if (emulate) {
        devicesToEmulate = [
            'iPhone 6 Plus',
            'Nexus 6'
        ];
    } else {
        if (tablet == 7) {
            devicesToEmulate = [
                'Tablet 7'
            ];
        } else {
            devicesToEmulate = [
                'Tablet 10'
            ];
        }
    }

    const browser = await puppeteer.launch();
    const page = await browser.newPage();

    // capture a screenshot of each device we wish to emulate (`devicesToEmulate`)
    for (let device of devicesToEmulate) {
        if (emulate) {
            await page.emulate(devices[device]);
        } else {
            if (tablet == 7) {
                await page.setViewport({ width: 1024, height: 600 , isMobile: true, hasTouch: true});
            } else {
                await page.setViewport({ width: 1280, height: 800 , isMobile: true, hasTouch: true});
            }
        }
        await page.goto('http://localhost:8100/', { waitUntil: 'domcontentloaded' });

        await page.waitForSelector('ion-content').then(async () => {
            await page.screenshot({path: `${device}-Home.png`, fullPage: true});
            await page.click('button.bar-button-menutoggle');
            await sleep(1000);
            await page.screenshot({path: `${device}-Menu.png`, fullPage: true});
            await page.click('button#Editor');
            await sleep(1000);
            await page.screenshot({path: `${device}-Editor.png`, fullPage: true});
            await page.click('button.bar-button-menutoggle');
            await sleep(500);
            await page.click('button#Player');
            await sleep(1000);
            await page.screenshot({path: `${device}-Player.png`, fullPage: true});
            await page.click('button.bar-button-menutoggle');
            await sleep(500);
            await page.click('button#Tutorial');
            await sleep(1000);
            await page.screenshot({path: `${device}-Tutorial.png`, fullPage: true});
            await page.click('button.bar-button-menutoggle');
            await sleep(500);
            await page.click('button#Settings');
            await sleep(1000);
            await page.screenshot({path: `${device}-Settings.png`, fullPage: true});
        });

    }

    await browser.close()
};

captureScreenshots();

```

Have fun!

---

<div class="post-metadata">

**Author:** ![EvanW](https://avatars.discourse-cdn.com/v4/letter/e/5daacb/32.png) [@EvanW](https://forum.ionicframework.com/u/EvanW)\
**Post date:** [May 11, 2018, 11:26am UTC](https://forum.ionicframework.com/t/automatic-screenshots-of-your-app-for-app-store-play-store/130265/2 "2018-05-11T11:26:30Z")

</div>

I don’t find the screenshots to be too much of a pain, personally. You just have to open up the emulator and take 5-10 screenshots on 4 devices (android phone/android tablet/iPhone/iPad).

It only takes me 20 minutes to screenshot everything and you don’t need to change marketing images unless your UI drastically changes or you want to advertise a specific new feature.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [July 19, 2021, 9:36pm UTC](https://forum.ionicframework.com/t/automatic-screenshots-of-your-app-for-app-store-play-store/130265/4 "2021-07-19T21:36:39Z")

</div>

Closed on July 19, 2021, 9:36pm UTC


