Enable screenshot for physical devices
Summary: Uses idb to get screenshot for physical devices. Reviewed By: jknoxville Differential Revision: D24017656 fbshipit-source-id: 89ffd17259d6f94d03a1442ffb341b79797f260b
This commit is contained in:
committed by
Facebook GitHub Bot
parent
a92aa126ae
commit
7358711e07
@@ -56,7 +56,10 @@ export default class IOSDevice extends BaseDevice {
|
||||
const tmpImageName = uuid() + '.png';
|
||||
const tmpDirectory = (electron.app || electron.remote.app).getPath('temp');
|
||||
const tmpFilePath = path.join(tmpDirectory, tmpImageName);
|
||||
const command = `xcrun simctl io booted screenshot ${tmpFilePath}`;
|
||||
const command =
|
||||
this.deviceType === 'emulator'
|
||||
? `xcrun simctl io booted screenshot ${tmpFilePath}`
|
||||
: `idb screenshot --udid ${this.serial} ${tmpFilePath}`;
|
||||
return promisify(exec)(command)
|
||||
.then(() => promisify(fs.readFile)(tmpFilePath))
|
||||
.then((buffer) => {
|
||||
|
||||
Reference in New Issue
Block a user