Pulmonary function testing (PFT) has important clinical value for the early detection of lung diseases, assessment of the disease severity, causes identification of dyspnea, and monitoring of critical patients. However, traditional PFT can only be carried out in a hospital environment, and it is challenging to meet the needs for daily and frequent evaluation of chronic respiratory diseases. In this study, we propose a novel method for accurately assessing pulmonary function by analyzing recorded forced cough sounds by mobile device without time and location restrictions. In the experiment, 309 clips of cough sound segments were separated from 133 patients who underwent PFT by using Audacity software. There are 247 clips of training samples and 62 clips of testing samples. Totally 52 features were extracted from the dataset, and principal component analysis (PCA) was used for feature reduction. Combined with biological attributes, the normalized features were regressed by using machine learning models with pulmonary function parameters (i.e., FEV1, FVC, FEV1/FVC, FEV1%, and FVC%). And a 5-fold cross-validation was applied to evaluate the performance of the regression models. As described in the experimental result, the result of coefficient of determination (R2) indicates that the support vector regression (SVR) model performed best in assessing FVC (0.84), FEV1% (0.61), and FVC% (0.62) among these models. The gradient boosting regression (GBR) model performs best in evaluating FEV1 (0.86) and FEV1/FVC (0.54). The result confirmed that the proposed method was capable of accurately assessing pulmonary function with forced cough sound. Besides, the cough sound sampling by a smartphone made it possible to conduct sampling and assess pulmonary function frequently in the home environment.