No matching provisioning profiles found only in command line tool
<p>My project is able to build and run on my iPhone using Xcode, which means both certificates and provisioning profiles are rightly set up. But if I try to use command line tool to run my app on my device, it tells me that no matching provisioning profiles found. What could be the problem? </p>

<p><a href="https://i.stack.imgur.com/c3Ezn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/c3Ezn.png" alt="enter image description here"></a></p>

<p>As you can see in this picture it shows no issue with certificate and provisioning profiles. But when I use command line tool, it failed.</p>

<p>This is what I type in command line:</p>

<pre><code>xcodebuild \
-workspace MyApp.xcworkspace \
-scheme Snail \
-configuration Debug \
-destination "platform=iOS,id=&lt;My Device UDID&gt;" \
CODE_SIGN_IDENTITY="iPhone Distribution: My Cert Name" \
clean test
</code></pre>

<p>Error in command line tool: </p>

<p><a href="https://i.stack.imgur.com/w0v4Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/w0v4Y.png" alt="enter image description here"></a></p>