Skip to content

Commit

Permalink
fix: first screenshot error
Browse files Browse the repository at this point in the history
  • Loading branch information
noomorph committed Jun 16, 2018
1 parent 4bb6978 commit 8b201c6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion detox/src/devices/AppleSimUtils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const os = require('os');
const process = require('process');
const _ = require('lodash');
const tempfile = require('tempfile');
Expand All @@ -7,7 +8,6 @@ const retry = require('../utils/retry');
const environment = require('../utils/environment');

class AppleSimUtils {

async setPermissions(udid, bundleId, permissionsObj) {
const statusLogs = {
trying: `Trying to set permissions...`,
Expand Down Expand Up @@ -230,6 +230,7 @@ class AppleSimUtils {
await this._bootDeviceMagically(udid);
}
await this._execSimctl({ cmd: `bootstatus ${udid}`, retries: 1 });
await this.takeScreenshot(udid, devNull()).catch(_.noop); // fails but enables further headless screenshotting
}

async _bootDeviceMagically(udid) {
Expand Down Expand Up @@ -263,6 +264,10 @@ class AppleSimUtils {
}
}

function devNull() {
return os.platform() === 'win32' ? 'nul' : '/dev/null';
}

class LogsInfo {
constructor(udid) {
const logPrefix = '/tmp/detox.last_launch_app_log.';
Expand Down

0 comments on commit 8b201c6

Please sign in to comment.