How can i add text custom field on product detail page?
The uc_attributes module, which has been part of Ubercart for 12 years, was specifically designed to handle this situation.

Enable the uc_attributes module. Edit your product, then go to the "Attributes" tab and add a "textfield" type attribute to your product. Your customer will then be able to add text to the purchased product. This textfield will be displayed in the cart, on the checkout page, on the review order page, and in the admin/user view of the completed order.

In short, the correct way to do this is to "Use Attributes and set up a Textfield attribute on your product" as I stated in my previous answer (which was erroneously turned into a "comment" by some unknown user).

The Ubercart project page at https://www.drupal.org/project/ubercart gives links to detailed information about how to do this. Specifically, see:
https://www.drupal.org/docs/7/modules/ubercart/all-about-products/product-attributes-and-options
and the video tutorial at https://www.youtube.com/watch?v=fVDOqI7Gge4