Server-side Swift in AppCode
In this short article we’ll take a look at various AppCode features that are useful for server-side Swift development, as now you can open standalone SPM projects in AppCode on macOS.
Check out and open the project
On the Welcome screen, click the Get from VCS button and enter the address of the Feather repository:
Click Clone. As soon as the project is checked out, it will be automatically opened in AppCode. After loading the project, AppCode will start syncing its dependencies declared in
Package.swift. You can manually invoke the synchronization later from
Tools | Swift Package Manager of from the Project view context menu:
All the code assistance available for Xcode projects works in pure SPM ones:
Run and Debug
Once the synchronization is complete, run configurations for executable targets and tests are automatically created in AppCode:
To run the project, we need to generate the
.env file. We can do this easily by executing the
make env command via Run Anything (
Next, as all the resources needed for running our blog are stored in the root folder of the project. We need to point the
Feather run configuration to this directory:
After that, we can run the project locally and open the blog in a browser by clicking on the link in the Run console:
Or you can add an additional step directly into the Feather run configuration to make the browser open automatically:
Debugging works in the same way as it does in Xcode projects, with all the same features. Just select the target you’d like to debug and press
We can run the Docker image included in the Feather project to test it on Linux:
Install the Docker plugin from
Preferences | Plugins
And that’s it: as soon as the docker image is started, we can navigate to
0.0.0.0:8080 and see the Feather-powered blog.
If you need to edit the
Dockerfile, simply open it in AppCode and the range of code assistance features will be available:
The same is true for
docker-compose.yml, as YAML support is bundled in AppCode by default.
AppCode has a built-in database client, just like DataGrip:
It allows you to connect to any database, local or remote. For example, we can use it to view the contents of
db.sqlite in our project:
To test an HTTP request, simply execute
Tools | HTTP Client | Test RESTful Web Service, enter the URL you’d like to test, and press
The formatted response will be displayed in the dedicated tool window. To save your requests, just put the
.http file in one of the project folders.
That’s it! We hope that the long-awaited standalone SPM project support in AppCode will make your development process easier and faster.
Your AppCode team
The Drive to Develop
Subscribe to Blog updates
AppCode 2023.1 Bug-Fix Update
Hi, AppCode 2023.1 has just been released with fixes for Xcode 14.3 compatibility, Swift refactorings and intentions, the IDE’s UI, and Kotlin Multiplatform Mobile. On December 14, 2022, along with the AppCode 2022.3 release, we sunsetted the product and stopped sales. While we’ve refocused the te…
AppCode 2023.1 Release Candidate
Hi, On December 14, 2022, along with the AppCode 2022.3 release, we sunsetted the product and stopped sales. While we’ve re-focused the team's efforts in other directions, we’ve kept providing technical support to our current users and are releasing bug-fix updates in 2023, targeting mostly the Xco…
AppCode 2022.3 Release and End of Sales and Support
AppCode 2022.3 has just been released. With the release of v2022.3, we are sunsetting the product.
AppCode 2022.3 Release Candidate Is Here
Hi everyone, The release of AppCode 2022.3 is approaching, and the release candidate (build 223.7571.233) is now available for download on our website. You need to have an active subscription or activate a free trial to use this build. The main highlights of this build include: We fixed the r…