How to fix iOS Simulator [native-run] ERR_DEVICE_LOCKED: Device still locked after 1 minute on the Apple Silicon (M1)?

Viewed 2492

Regardless of --target variable, the following commands fail:

ionic cordova run ios --target="iPhone-X"

ionic cordova run ios --target="iPhone 12"

ionic cordova emulate ios --debug --target="iPhone 11" -- --buildFlag="-UseModernBuildSystem=0"

The error is:

[native-run] ERR_DEVICE_LOCKED: Device still locked after 1 minute. Aborting.
[ERROR] An error occurred while running subprocess native-run.

It's happening after I switched to Apple Silicon (M1) MacBook Pro, but I'm not 100% sure. Thanks!

4 Answers

I'd the same issue today and it turns out that it works using the "Target ID" instead of "Target Name".

  1. Check the list of available targets using --list option
ionic cordova run ios --list
  1. Run the same command with TARGET ID.
ionic cordova run ios --target="...TARGET-ID-1A2B3B..."

Just to mention, I'm on INTEL-based MacBook Pro.

This worked for me!

Check the list of available targets using --list option

ionic cordova run ios --list

Run the same run command with TARGET ID.

ionic cordova run ios --target="XXXXXXXXXXXXXXX"

For me this message occured in a different situation. The device has not yet been registered to the Apple account!

So I started it once with XCode, it registered the device automatically (for me) and then it was working.

Here, I executed:

native-run ios --virtual --list

And next,

cordova build ios --debug --emulator && native-run ios --app platforms/ios/build/emulator/MyApp.app --virtual --forward 8100:8100 --target <TARGET ID>

Other alternative:

native-run ios --app platforms/ios/build/emulator/MyApp.app --virtual --forward 8100:8100 --target <TARGET_ID>
Related