Here are step by step instructions, I think you might be missing step 2:
1) Set Build Library for Distribution
in the build settings for the target framework to YES
2) Again in the build settings, set Skip Install
to NO
otherwise the framework won't show up in the Archive output folder.
3) Archive from the Xcode Product menu after selecting your Generic iOS Device
the output will appear in the Organizer. Control-Click on the Archive. Select Show in Finder
Drag that to the terminal to get the path to the archive and append the path (yellow part is the dragged path, gray is navigated in subfolders). In this case it looks like this, I used the ~ to avoid showing entire path.
~/Library/Developer/Xcode/Archives/2019-06-22/Output\ 6-22-19,\ 11.50\ AM.xcarchive/Products/Library/Frameworks/MyFramework.framework
4) Then create the XCFramework by inserting the command in front of the above path:
xcodebuild -create-xcframework -output Output.xcframework -framework ~/Library/Developer/Xcode/Archives/2019-06-22/Output\ 6-22-19,\ 11.50\ AM.xcarchive/Products/Library/Frameworks/MyFramework.framework
5) You then should see the output:
xcframework successfully written out to: ~/Project/Output.xcframework
I expect that someday soon Xcode will add a the ability to directly create the XCFramework without the command line.