How to upgrade Xcode 9 to Xcode 10.1 in mac OS Sierra 10.12.6 (16G1815)
Xcode 10.1 is not supported in macOS Sierra. You’ll need macOS High Sierra it later to run Xcode 10.1.

Since your model of MacBook Pro supports running macOS High Sierra, it's recommended that you upgrade to it. You can install current latest version of Xcode 10.2 in macOS High Sierra 10.13.6.