How to configure Android Studio to use TFS source control

Ayyoub Jadoo
3 min readMar 14, 2019

--

Android Studio and TFS

Source version control is a mandatory element in any type of software development, there are many available tools to manage your code such as Git, SVN, TFS,…

Android Studio is very friendly and has straight forward flow with Git, but once I had to work on a new native Android project in a company that uses TFS for it’s code versioning, so I started my journey to make Android Studio and TFS friends.

I found that there is a plugin for Android Studio (developed by Microsoft) and started to get it to work and at the end after two days of trying it worked like a charm!, but unfortunately I didn’t found it straight forward so I decided to write my experience here, I hope that this article will save your time and make things easier.

Installing the Plugin

1. Open Android Studio and go to File => Settings => Plugins, click “Browse repositories” and search for “Visual Studio Team Services” plugin and click install.

2. Download the latest “TEE-CLC-xx.yyy.z.zip” from https://github.com/Microsoft/team-explorer-everywhere/releases.

3. Extract it in a known location and find tf.cmd file inside that location.

4. In Android Studio go to File => Settings => Version Control => TFVC

5. Set the command-line path to the location of tf.cmd on your machine.

6. Press “Test”, a dialog message should be displayed with “Valid TF excutable found”.

7. In case that the test is failed you can read the message and check the cause, if the error is caused by JVM memory allocation then you have to edit the tf.cmd file to match JVM -Xmx parameter on your machine, open the file for editing and find “Xmx” and modify it and test again, for example I changed it from -Xmx2048M to -Xmx1024M and it worked. (depends on your JVM configurations).

Connecting to TFS

1. Create a new team project or empty directory in a team project for your android project on TFS if not existing.

2. In Android Studio, go to File => New => Project From Version Control => Team Services TFVC

3. Follow the sign-in wizard entering your TFS account credentials.

4. A list of your team projects will be shown, choose the new one which you created for your android project (you can choose a specific directory inside the team project too).

5. Press Create Workspace.

6. From Settings => Version Control, configure your project to use “TFVC” instead of the default “Git” and save.

How to Do Basic Actions

1. To get latest from your repository go to VCS => Update Project or press Ctrl+T

2. To check-in your changes to the server go to VCS => Commit or press Ctrl+K, choose changes then press “Check in”.

3. To update/reconfigure your TFS credentials go to Settings => Version Control => Team Services / TFS.

I hope this was useful for you, good luck and happy coding!

Written with love by Ayyoub Jadoo

--

--

Ayyoub Jadoo

Senior Full-Stack Software Engineer with an experience in C#.Net, Ruby on Rails, JavaScript, Front-end and Mobile Development