'Watch OS app installation error - Could not attach to pid : “11996”

We've added a watch app extension in the developed iOS application source code. When we're selecting and running the watch application target, We're getting this application installation error with an alert:

Could not attach to pid : “11996”

attach failed ((os/kern) invalid argument)

enter image description here

This alert is coming only on M1 chip-based Mac systems. But the same code is running well on Intel-based Mac systems.

Any help from anyone is highly appreciable. Thank you.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source