You could follow below:-
1.Select your swiftDemo in your xcode(left-hand side as shown) Then select Product option, in which you could select Archive option.
Select the Save to ad-hoc deployment as below
5. then if you have not sign with your apple developer id then below screen would pop-up
6. Now select add in this and provide your apple id and password in new window as shown.