Confusion on App ID and Bundle ID
I think I see your confusion. The Bundle ID and the App ID have to match, but they are not in fact the same thing. The App ID is what is in iTunes Connect, the Bundle ID is what is found in your app (Xcode project). You can't change your App ID once your app is in the store, and since your Bundle ID has to match your App ID to release your app, they are sometimes referred to as the same.
If you create a new project, you can set your Bundle ID to the App ID in the iTunes Connect, and it will be accepted by iTunes Connect.
EDIT: Picture of where to find accepted Bundle ID in iTunes Connect.
should I use a new apple bundle id or use the same bundle id with ios app when publish a macos app
You should use different bundle id for every application you are going to created with apple. No matter you are developing iOS, macOS, watchOS application. Every application should have different bundle id for uniqueness.
The bundleIds resource represents the app's unique identifier that you can register, modify, and delete. You need a bundle ID before you can assign capabilities with the Bundle ID Capabilities resource or create a provisioning profile with the Profiles resource.
What does bundle identifier mean in an iOS project?
According to Apple docs:
A bundle identifier lets iOS and macOS recognize any updates to your app. Your bundle ID must be registered with Apple and be unique to your app. Bundle IDs are app-type specific (either iOS or macOS). The same bundle ID cannot be used for both iOS and macOS apps.
Edit
Since Xcode 11.4, you can use same bundle identifier for both iOS and macOS app if you want to support universal purchase feature.
From Release Note
Xcode 11.4 supports building and distributing macOS apps as a universal purchase. To distribute your macOS app as a universal purchase, specify the same bundle identifier as your iOS app in the Xcode template assistant when creating a new project. If you have an existing project, edit its bundle identifier in the Project Editor.
XCode - Failed to register bundle identifier
Change "com.example.Project5" to "com.YourDevName.YourNameProject"
Related Topics
Invalid Signature - Code Object Is Not Signed at All
iOS Documents Directory Size Limit
Disable the Interactive Dismissal of Presented View Controller
Change Uitextfield and Uitextview Cursor/Caret Color
Change the Color of iOS Navigation Bar
Invalid Update: Invalid Number of Items on Uicollectionview
How to Convert .Dae to .Scn Files in Scenekit
How to Get iOS Appstorereceipturl into Base 64 Encoded String
Ios: Present View Controller Programmatically
Change Table to Edit Mode and Delete Rows Inside a Normal Viewcontroller
How to Identify Ekevent Uniquely with Sync Across the Devices
Over the Air (Ota) iOS IPA File Distribution for Public
How to Loop Through Uitableview's Cells
Align Text Using Drawinrect:Withattributes: