Code signing error when try to run on IOS device


I am new to the IONIC development world. Feel great for the tools that are provided by ionic framework and glad to see one build that can be used for different mobile devices. I am following the book “mobile development with ionic, revised edition” to have a full feeling about the platform. Everything runs fine when I build my application and test it in the emulator. However, I am getting issues when I tried to follow the instructions to connect my iPhone to my Mac book and test the application on iPhone directly. I followed the steps to set up the environment and finally run the command “ionic Cordova run iOS -l -c”. I am getting the Cordova compile error such as:

Code Signing Error: Signing for “XXXXX” requires a development team. Select a development team in the project editor.
Code Signing Error: Code signing is required for product type ‘Application’ in SDK ‘iOS 11.1’

I am running Xcode 9 and I have the development team set up already. When I run a dummy project directly in Xcode with my phone connected, I can see the application is running on my phone. However, when I run it with the command line, it does not work.

I checked the internet and I can see some other posts for the similar issue. But none of the solution works for my case. I am wondering that someone has the similar issue and can give me some suggestions.

Many thanks for the help.

I am running latest ionic version 3.19 and Xcode 9.1

I found a solution after I post my question. My issue is for the bundle identifier since it is not unique. I actually tried to open the ionic build project from Xcode and it is more straightforward way to view it, This question can be closed. Thanks.