Last active
January 9, 2021 06:53
-
-
Save cb1kenobi/19dc4c547864a96bfa9027aae5631e67 to your computer and use it in GitHub Desktop.
Resets all iOS, watchOS, and tvOS simulators
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const execSync = require('child_process').execSync; | |
const json = JSON.parse(execSync('xcrun simctl list --json')); | |
for (const runtime of Object.keys(json.devices)) { | |
for (const device of json.devices[runtime]) { | |
console.log(`Removing ${device.name} (${device.udid})`); | |
execSync(`xcrun simctl delete ${device.udid}`); | |
} | |
} | |
for (const deviceType of json.devicetypes) { | |
for (const runtime of json.runtimes) { | |
if (runtime.isAvailable || runtime.availability === '(available)') { | |
console.log(`\nCreating ${deviceType.name} with ${runtime.name}`); | |
try { | |
execSync(`xcrun simctl create '${deviceType.name} ${runtime.name}' ${deviceType.identifier} ${runtime.identifier}`); | |
console.log('SUCCESS!'); | |
} catch (e) {} | |
} | |
} | |
} | |
console.log(); | |
console.log(execSync('xcrun simctl list').toString()); |
As the error indicates, your simulator is not available. You should try to manually launch it, then reset it. You can also do this via simctl.
Secondly, tn
is a community project and is not supported by me or the Titanium team, please use the Appc CLI (or Titanium CLI).
Lastly, this gist is not the correct place to get Titanium support. I recommend hopping on https://ti-slack.slack.com/ or request an account at https://jira.appcelerator.org/ and file a ticket.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Its works as per this tidev/ioslib#114 but actual issue not able to solve using this.
I ran command then i tried
tn iphone-8
commandbut still same error.