Getting error while build android and ios

While running sudo ionic cordova emulate ios --target iPhone-SE

I’m getting error below:


io.ionic.starter: 1564
Error: ENOENT: no such file or directory, stat ‘/Users/mac/Library/Logs/CoreSimulator/888C6571-60AD-4D9E-9CE5-C42CCB9BCF4A/system.log’
[ERROR] An error occurred while running cordova emulate ios --target iPhone-SE
(exit code 1).

While running sudo ionic cordova build android
getting error blow:

Android Studio project detected

(node:1712) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio

Ionic info below:

cli packages: (/usr/local/lib/node_modules)

@ionic/cli-utils  : 1.19.1
ionic (Ionic CLI) : 3.19.1

global packages:

cordova (Cordova CLI) : 8.0.0 

local packages:

@ionic/app-scripts : 3.1.8
Cordova Platforms  : android 7.0.0 ios 4.5.0
Ionic Framework    : ionic-angular 3.9.2


ios-sim : 6.1.2 
Node    : v6.11.3
npm     : 5.6.0 
OS      : macOS High Sierra
Xcode   : Xcode 9.2 Build version 9C40b 

Environment Variables:

ANDROID_HOME : not set


backend : pro

For iOS: Can you start a simulator form Xcode directly?
For Android: What does ionic cordova requirements return? Did you install Gradle from

When i’m opening in xcode, i am getting error

08 AM

Permission problem, as it says. Did you run anything with sudo? Why?