Encountered internal error running command: Error: Installing com.xxxxx.remoteOn.NonProd failed

I am using macOS 10.12.4(sierra). Appium server 1.5.3 with xcode 8.3.2 . Trying to automate an app on ios 10.2.1

The appium doctor says everything is configured correctly, but when i try to use the inspector i get the below error:

Encountered internal error running command: Error: Installing com.xxxxxxx.remoteOn.NonProd failed
at /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/node_modules/node-idevice/main.js:159:6
at ChildProcess.exithandler (child_process.js:195:7)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Socket. (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)

I tried to solve it using the solution given here “https://github.com/appium/appium/issues/6914”. But still no luck. Can you please guide me on how to resolve this?

I prefer to use appium server 1.5.3 as it has the UI and its easier to inspsect elements here.