The accuracy of the scale-resolving simulations for practical geometries strongly depends on the inflow boundary conditions. Imposing experimentally observed turbulent inflow profiles for the numerical simulations is a major challenge. Existing methods available in the literature assume self-similar behavior, which is not true for most of the experiments. In the present work, we formulate the turbulent inflow profile generation technique as an optimization problem. An adjoint technique is exploited to evaluate the sensitivities of multiple input parameters for the present problem. The present formulation is then tested to generate a laminar boundary layer profile, turbulent boundary layer profile, and turbulent jet profile.