Using Github to hand in exercises and labs or sharing your code with teammates or the world.

Being an assistant professor at Karlstad University within software engineering means I handle a ton of student-written source-code. To streamline and also prepare my students for what to expect in real life when it comes to managing source-code I have for many many years started each of my courses with a brief introduction to source-code managing using SCM tools (initially I used subversion and for a couple of years I am instead using git). I will in this blogpost illustrate the necessary steps to hand in exercises using Github as a remote (or shared source for source-code).

The idea is that you already have a working local git repository with the exercises/labs you need to hand in to me for grading. In another blogpost (https://illidiumq36.wordpress.com/2017/04/23/start-using-git-for-solo-development-simplified-initial-workflow) I introduce a simplified way of working with git to achieve this locally.
So imagine we have a situation as described in the picture below. The content of the local repository is what you would like to hand in to me. To do so you need to somehow provide me with a copy. In gitlingo this means that you need a remote repository (mirror or copy) of your repository that you can share with me over the internet. Then you can invite me to this remote repository and by making sure that your remote repository reflects the content of your local repository you only need to provide me with the address of the remote repository for me to be able to grade your code based exercises and labs (supersimple and superconvenient). And the entire process for syncing between repositories is already built in to git.

workflow-local-solo

Github is a great service that provides developers with free remote repositories. And then allows you to very simply share these remote repositories with the rest of the world. You can create public repositories which means that anyone, the whole world, can see, copy and use your code or you can create private repositories which means that only the people you actively invite to the repository can use it in a definable way. You can have certain users that can only see and use your code, others can provide changes etc.

Screen Shot 2019-08-19 at 09.55.14

NOTE: You need to only use private repositories for all exercises and labs that are part of my university courses!

To make it possible for me to keep repositories organized I also require that you name your remote repository following these naming conventions:

Year-coursecode-lastname

For instance if you are attending ISGC12, it is 2019 and your last name is Bar your remote repository should be named

2019-isgc12-bar

To create a remote repository at Github

To be able to do this you need to have a registered account at Github. You can and should start out with the free plan Github Signup.

Just follow these steps

1. Login

Open github.com in a browser and login using your github account.

2. Create a new remote repository.

To create a new remote repository you hit the plus icon in the top right corner. And choose “New repository”

Screen Shot 2019-08-19 at 10.13.17

hen you enter the remote repository name (if it is for a hand in to me you follow the naming conventions provided above). Make sure it is a private repository and add a README and a proper .gitignore from the list.

Screen Shot 2019-08-19 at 10.20.34.png
3) Clone this repo to your local machine or connect an already existing local repo.

The easiest way to start using the remote repository is to make the remote first and then clone this to your local machine. When it is locally cloned you can start using it locally. The clone address can be found on the green “Clone or download” button.

Screen Shot 2019-08-19 at 10.41.03

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder
Illidium-Q36: benc$ git clone https://github.com/bennchri/2019-isgc12-christiansson.git
[Enter Github credentials]

Recently (210813) Github changed the rules for https access for some users to not allow the usage of the personal password when communicating with Github instead of your password you need to use a so called Personal Token. To generate a personal token you go to your settings in Github

Then scroll down to Developer Settings

Then select “Personal Access Token”

Now you can click on “Generate Personal Access Token”

Then you need to provide a Note and set an expiration date for the token, when token expires you need to redo this process again to generate a new token. You also need to check the “repo” scopes.  Scroll down and press the “Generate token” button at the bottom.

Now you get a Personal Access Token which you can use as your password when interacting with github over https. You need to copy the token string (this acts as your password when using the console and github). Please keep the token safe (it is a temporary password).

Now you can start adding source code to your local clone and then push your local changes to github (see below)

If you already have a local repository and you want to connect that repository to the remote you need to follow these steps:

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder/2019-isgc12-christiansson

Illidium-Q36: benc$ git remote add origin https://github.com/bennchri/2019-isgc12-christiansson.git

Now we have added a connection between our local git repository to the remote Github repository.  If you added a README and a .gitignore to your remote repository you need to sync up the content of your local and remote repositories before you can start pushing and pulling (see below). To do this you also need to accept and save the suggested merge and save the suggested merge content and comment.

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder/2019-isgc12-christiansson
Illidium-Q36: benc$ git pull origin main --allow-unrelated-histories

[provide github credentials]

From github.com:bennchri/2019-isgc12-christiansson

 * branch            main     -> FETCH_HEAD

Merge made by the 'recursive' strategy.

 .gitignore | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

 README.md  |  1 +

 2 files changed, 66 insertions(+)

 create mode 100644 .gitignore

 create mode 100644 README.md

4. Push your local content to the remote Github repository

To mirror the content in your local repository to your remote Github repository you use the git command ‘git push‘. It pushes changes from local to remote. I recommend that you push often as this gives you a backup of your source code. Make sure to have pushed the content and version of code you want to hand in when handing in.

Illidium-Q36: benc$ git push -u origin main

[provide github credentials]
Delta compression using up to 8 threads.

Compressing objects: 100% (14/14), done.

Writing objects: 100% (17/17), 1.94 KiB | 0 bytes/s, done.

Total 17 (delta 5), reused 0 (delta 0)

To https://github.com/studde_student/2017-isgc12-bar.git

 * [new branch]      main -> main

Branch main set up to track remote branch main from origin.

Screen Shot 2019-08-19 at 09.55.14

5. If someone else (for instance me) pushes changes to your remote you can retrieve them locally by doing something called a pull.

This means that you sync changes from remote to local (the opposite way from a push).

Screen Shot 2019-08-19 at 11.18.09.png

Of course you control who is able to push to your remote if any.

Illidium-Q36: benc$ git pull origin main

From github.com:bennchri/2019-isgc12-christiansson

 * branch            main     -> FETCH_HEAD

Updating 58286f4..41e1961

Fast-forward

 src/HelloWorld.java | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)

As you can see I had local uncommitted changes  which now are removed as I asked for a sync to the same state as the remote repository.

6. To hand in exercises and labs.

To hand in to me you have to add me to your remote repository as it is private.  You do that by navigating to your repository overview page on Github. Then you locate the settings tab. Choose Collaborators and add me by writing my username.

Screen Shot 2019-08-19 at 11.20.36.png

Now you just need to provide me with the github remote repository address ,not the https version, but rather the ssh version. Usually you provide the Github address in the hand in function in our e-learning platform (currently Canvas). In our case that would be

git@github.org:studde_student/2017-isgc12-bar.git

Please observe that you can access your remote repository using “https” or “ssh”. In the sample below “ssh” is chosen.

Screen Shot 2019-08-19 at 12.10.05.png

Posted in Uncategorized | 1 Comment

Using Bitbucket to handle hand in exercises and labs the teacher version.

Being an assistant professor at Karlstad University within the software engineering field means I handle a ton of student-written source-code and software development artefacts. To streamline and also prepare my students for what to expect in real life when it comes to managing source-code I have for many years started each of my courses with a brief introduction to source-code managing using SCM tools (initially I used subversion and for a couple of years I am instead using git). In a previous blogpost (https://illidiumq36.wordpress.com/2017/04/28/using-bitbucket-to-hand-in-exercises-and-labs-or-sharing-your-code-with-teammates-or-the-world/) I illustrated the process I am using from a student perspective. Then Kelvin Yap, Product Marketing Manager, at Atlassian reached out to me and asked if it wasn’t a good idea to also describe the same process but from a teacher perspective. So in this blogpost I will illustrate the process I use for handling hand ins containing programming artefacts (source-code, UML diagrams, and other resources) using Bitbucket as a remote (or shared source for source-code) from a teacher perspective.

The idea is that the student(s) already have a working local git repository with all the artefacts required to be handed in. In another blogpost (https://illidiumq36.wordpress.com/2017/04/23/start-using-git-for-solo-development-simplified-initial-workflow) I introduce a simplified way of working with git to achieve this locally.
So imagine we have a situation as described in the picture below. The content of the local repository is what the student(s) would like to hand in to me.

workflow-local-solo

To do so they need to somehow provide me with a copy of the repository. In gitlingo this means that we need a remote repository (mirror or copy) of the local repository that the students then can share with the teacher over the internet. When this remote repository is created the student then need to invite you as a teacher to this remote repository and by making sure that the remote repository reflects the content of the local repository they only need to provide the address of the remote repository in the handin assignment. Now you as a teacher are able to checkout the handin artefacts and do the grading (super simple and super convenient). As a cherry on top git already comes with all the tools for syncing between repositories and Bitbucket is a great service that provides developers with free remote repositories. And then allows you to very simply share these remote repositories with the rest of the world. You can create public repositories which means that anyone, the whole world, can see, copy and use your code or you can create private repositories which means that only the people you actively invite to the repository can use it in a by you definable way. You can have certain users with readonly access, and others can have write privileges etc.

workflow-remote-solo-push

 

NOTE: I recommend that you use private repositories for hand ins used in examination, as public repositories can be read by the entire world.

To make it possible for you as a teacher to keep repositories organised I also recommend that you have some kind of naming policy for the repositories. For instance I use the following naming convention:

Year-coursecode-lastname

For instance if you are giving a class named ISGC12, it is 2017 and the student’s  last name is Bar the remote repository should be named

2017-isgc12-bar

To create a remote repository using Bitbucket

Just follow these steps

1. Login

https://bitbucket.org/account/signin/, if you don’t have a Bitbucket user account you either sign up or use an existing google login to set up a new Bitbucket account (it is a great service that is free of charge).

Screen Shot 2017-04-28 at 13.57.03

2. Create a new remote repository.

To create a new remote repository you hit the big plus sign.

Screen Shot 2017-04-28 at 14.10.07Then you select to create a new repository. And then you enter the remote repository name. Also make sure it is a private repository if that is a requirement. Choose git as repository type. Furthermore make sure you only allow private forks (or no forks). If you need to you can add both issue tracking and a dedicated Wiki.

Screen Shot 2017-04-28 at 14.14.39

3) Connect your local repository with the remote repository to enable mirroring of contents.

To connect your local repository to the remote repository you just created you can follow the instructions given by Bitbucket.

Screen Shot 2017-04-28 at 14.24.22

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder/source-code-management-101

Illidium-Q36: benc$ git remote add origin https://studde_student@bitbucket.org/studde_student/2017-isgc12-bar.git

Now we have added a connection between our local git repository to the remote Bitbucket repository.

4. Push your local content to the remote Bitbucket repository

To mirror the content in your local repository to your remote Bitbucket repository you use the git command ‘git push’. It pushes changes from local to remote. I recommend that you push often as this gives you a backup of your source code. Make sure to have pushed the content and version of code you want to hand in when handing in.

Illidium-Q36: benc$ git push -u origin master
Password for 'https://studde_student@bitbucket.org': 
Counting objects: 17, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (14/14), done.

Writing objects: 100% (17/17), 1.94 KiB | 0 bytes/s, done.

Total 17 (delta 5), reused 0 (delta 0)

To https://bitbucket.org/studde_student/2017-isgc12-bar.git

* [new branch]      master -> master

Branch master set up to track remote branch master from origin.

workflow-remote-solo-push

5. If someone else (for instance exercise partner/ code reviewer/tutor or teacher) pushes changes to your remote you can retrieve them locally by doing something called a pull.

This means that you sync changes from remote to local (the opposite way from a push).

workflow-remote-solo-pull

Of course the remote repository owner control who is able to push to the remote repository if any.

Illidium-Q36: benc$ git pull origin master

From https://bitbucket.org/studde_student/2017-isgc12-bar

* branch            master     -> FETCH_HEAD

Updating 58286f4..41e1961

Fast-forward

src/HelloWorld.java | 6 ++----

1 file changed, 2 insertions(+), 4 deletions(-)

As you can see I had local uncommitted changes  which now are removed as I asked for a sync to the same state as the remote repository.

6. To hand in exercises and labs.

To do an assignment hand in the student owning the remote repository have to add you as a teacher with sufficient privileges to the remote repository if it is private.  They do that by navigating to the repository overview page on Bitbucket. Then they locate the “Send invitation button“.

Screen Shot 2017-04-28 at 14.48.03

Enter the appropriate user name(s) and add them to the repository.

Now the student just needs to provide you as the grading teacher with the Bitbucket remote repository address (for ease of use I recommend using the ssh version not the https version)

git@bitbucket.org:studde_student/2017-isgc12-bar.git

You can find your remote repository address here:

Screen Shot 2017-04-28 at 14.41.13

Posted in Uncategorized | Leave a comment

Using Bitbucket to hand in exercises and labs or sharing your code with teammates or the world.

Being an assistant professor at Karlstad University within software engineering means I handle a ton of student-written source-code. To streamline and also prepare my students for what to expect in real life when it comes to managing source-code I have for many many years started each of my courses with a brief introduction to source-code managing using SCM tools (initially I used subversion and for a couple of years I am instead using git). I will in this blogpost illustrate the necessary steps to hand in exercises using Bitbucket as a remote (or shared source for source-code).

The idea is that you already have a working local git repository with the exercises/labs you need to hand in to me for grading. In another blogpost (https://illidiumq36.wordpress.com/2017/04/23/start-using-git-for-solo-development-simplified-initial-workflow) I introduce a simplified way of working with git to achieve this locally.
So imagine we have a situation as described in the picture below. The content of the local repository is what you would like to hand in to me. To do so you need to somehow provide me with a copy. In gitlingo this means that you need a remote repository (mirror or copy) of your repository that you can share with me over the internet. Then you can invite me to this remote repository and by making shure that your remote repository reflects the content of your local repository you only need to provide me with the address of the remote repository for me to be able to grade your code based exercises and labs (supersimple and superconvenient). And the entire process for syncing between repositories is already built in to git.

workflow-local-solo

Bitbucket is a great service that provides developers with free remote repositories. And then allows you to very simply share these remote repositories with the rest of the world. You can create public repositories which means that anyone, the whole world, can see, copy and use your code or you can create private repositories which means that only the people you actively invite to the repository can use it in a definable way. You can have certain users that can only see and use your code, others can provide changes etc.

workflow-remote-solo-push

NOTE: You need to only use private repositories for all exercises and labs that are part of my university courses!

To make it possible for me to keep repositories organized I also require that you name your remote repository following these naming conventions:

Year-coursecode-lastname

For instance if you are attending ISGC12, it is 2017 and your last name is Bar your remote repository should be named

2017-isgc12-bar

To create a remote repository at Bitbucket

Just follow these steps

1. Login

https://bitbucket.org/account/signin/, if you don’t have a Bitbucket user account you either sign up or use an existing google login to set up a new Bitbucket account (it is a great service that is free of charge).

Screen Shot 2017-04-28 at 13.57.03
2. Create a new remote repository.

To create a new remote repository you hit the big plus sign.

Screen Shot 2017-04-28 at 14.10.07

Then you select to create a new repository. And then you enter the remote repository name (if it is for a hand in to me you follow the naming conventions provided above). Also make sure it is a private repository and that you use git. Furthermore make sure you only allow private forks (or no forks). If you need to you can add both issue tracking and a dedicated Wiki. If I require any of that this it will be clearly stated in your assignment, otherwise you can leave them be.

Screen Shot 2017-04-28 at 14.14.39
3) Connect your local repository with the remote repository to enable mirroring of contents.

To connect your local repository to the remote repository you just created you can follow the instructions given by Bitbucket.

Screen Shot 2017-04-28 at 14.24.22

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder/source-code-management-101

Illidium-Q36: benc$ git remote add origin https://studde_student@bitbucket.org/studde_student/2017-isgc12-bar.git

Now we have added a connection between our local git repository to the remote Bitbucket repository.

4. Push your local content to the remote Bitbucket repository

To mirror the content in your local repository to your remote Bitbucket repository you use the git command ‘git push‘. It pushes changes from local to remote. I recommend that you push often as this gives you a backup of your source code. Make sure to have pushed the content and version of code you want to hand in when handing in.

Illidium-Q36: benc$ git push -u origin master
Password for 'https://studde_student@bitbucket.org': 
Counting objects: 17, done.

Delta compression using up to 8 threads.

Compressing objects: 100% (14/14), done.

Writing objects: 100% (17/17), 1.94 KiB | 0 bytes/s, done.

Total 17 (delta 5), reused 0 (delta 0)

To https://bitbucket.org/studde_student/2017-isgc12-bar.git

 * [new branch]      master -> master

Branch master set up to track remote branch master from origin.

workflow-remote-solo-push

5. If someone else (for instance me) pushes changes to your remote you can retrieve them locally by doing something called a pull.

This means that you sync changes from remote to local (the opposite way from a push).

workflow-remote-solo-pull

Of course you control who is able to push to your remote if any.

Illidium-Q36: benc$ git pull origin master

From https://bitbucket.org/studde_student/2017-isgc12-bar

 * branch            master     -> FETCH_HEAD

Updating 58286f4..41e1961

Fast-forward

 src/HelloWorld.java | 6 ++----

 1 file changed, 2 insertions(+), 4 deletions(-)

As you can see I had local uncommitted changes  which now are removed as I asked for a sync to the same state as the remote repository.

6. To hand in exercises and labs.

To hand in to me you have to add me to your remote repository as it is private.  You do that by navigating to your repository overview page on Bitbucket. Then you locate the “Send invitation button“.Screen Shot 2017-04-28 at 14.48.03

My username is provided in the assignment and then you add me to your repository.

Now you just need to provide me with the Bitbucket remote repository address not the https version but rather the ssh version. Usually you provide the Bitbucket address in the hand in function in our e-learning platform (currently Its Learning). In our case that would be

git@bitbucket.org:studde_student/2017-isgc12-bar.git

You can find your remote repository address here:

Screen Shot 2017-04-28 at 14.41.13

Posted in Uncategorized | 1 Comment

Start using git for solo development (simplified initial workflow)

Using and understanding source code version control systems is key in becoming a software developer. At Karlstad University in Sweden where I work as an assistant professor I introduce students to source code version control every year. This means that I get a good insight into what students usually have issues understanding and also good ways in getting started in using version control. In this blogpost I would like to present a very simplified initial workflow for solo development using git only locally. I am fully aware that this workflow is not sufficient in many situations especially if you work in a multi-developer setup and also have some obvious flaws like no backup from a secondary repository storages. But remember that this is intended as an gentle introduction to a workflow that acts as the first contact with version control. I have written a set of additional blogpost entries that remedies and extends the shortcomings of this introductory workflow. Please look at:

What is source code version control?

With source code version control (SVC) we mean a tool that provides you the abilities to view and browse a complete history of your project from beginning to end and also the ability to revert to any previous state or see the differences between states. This means that we can look at our source code at different points in time and also revert to a previous version (point in time) if needed. You have probably experienced the need for this at some point if you have written any computer based documents previously, but this is even more crucial when you write source code. In this blogpost we are going to focus on using git (https://en.wikipedia.org/wiki/Git).

SVC and its relation to your IDE

You are probably using an IDE (Integrated Development Environment) for writing your source code and depending on your required IDE it may or may not have SVC support integrated already. Initially I however do not recommend using SVC functionality directly from within an IDE. I base this recommendation on three reasons:

  1. It is very easy the get SVC functions mixed up with IDE functions. Ie it can be very difficult to understand what the SVC system actually is doing for you. When things feel like magic this is oftentimes the case.
  2. Different IDEs integrate SVC functionality differently, this means that you are limited to using SVC from within one specific tool instead of knowing how to use SVC with ANY tool.
  3. By using SVC functionality separately you will be required to understand what it does and how you use it in itself.

Installing git

Please have a look at https://git-scm.com/book/en/v2/Getting-Started-Installing-Git and based on your choice of operating system choose one of the install methods provided.

NOTE: When installing on Windows I recommend that you use Git bash

When git is properly installed you should see something similar to this when running the command ‘git –version‘ in CLI mode (in a shell or from the command prompt)

Illidium-Q36:~ benc$ git --version
git version 2.9.3 (Apple Git-75)

Files to source control in relation to your IDE

You basically use the necessary tools required for writing source-code (like Eclipse, Intellij, Developer Studio, Atom, vim, Emacs, basically any editor). You create the files you need containing the resources you need for the piece of software you are writing. Many IDE’s manages the entire project (the set of files you need) for you and you may not even be totally aware of exactly which files you actually are creating as the tools can be very “helpful” in automating and also “assist” you with required boiler-plate stuff. This is of course very helpful when you know what you are getting help with but if not you may be completely unaware of what actually goes on with your project.

As an example lets look at a simple project in Eclipse. Basically what we have here is one java class called HelloWorld, and as you can see in the IDE this is the only file we have created and we can be mislead to believe that this is the only file we currently need to maintain in Eclipse. But in reality the IDE (Eclipse) in this case oftentimes creates a set of additional files for different purposes (which will vary depending on for example choice of IDE, language we develop in, and framework we use for development).

Screen Shot 2017-04-22 at 16.44.03

As you can see I have created one source code file called HelloWorld.java here. But if we look in the actual directory for the project we find that there are a lot more files and even directories there than only the expected HelloWorld.java:

.
├── .classpath
├── .project
├── .settings
│   └── org.eclipse.jdt.core.prefs
├── bin
│   └── HelloWorld.class
└── src
 └── HelloWorld.java

As we can see Eclipse have generated a directory structure, compiled the source code into java bytecode, and created a set of other files. If we currently assume that all of these files constitutes our project all of these files should be kept together to ensure that our piece of software will be built in the same way every time. However we do not want to version control all IDE and environment specific files that are generated automatically or the output from a build. These files can be generated automatically when and as needed. To avoid placing these files in a git repo git uses a special file called .gitignore . As the name implies a .gitignore file tells git which files to ignore ie not version control. This also means that the .gitignore file needs to be committed before the automated files are added to the repo. If a file has been committed it will not be removed even if we add that file to our .gitignore. A good practise is to always add a .gitignore file directly after you have run git init. A set of good .gitignore files can be found at https://github.com/github/gitignore . Just choose one and add it to the root directory of your git repo.

To place these files under version control we need to figure out where the IDE placed the files on our computer and then initialize version control functionality there. This being Eclipse we browse to our workspace location and there we will find a folder with our project name.

Illidium-Q36: benc$ cd /Users/benc/eclipse/workspace-folder
Illidium-Q36: benc$ ls
source-code-management-101
Illidium-Q36: benc$ cd source-code-management-101/
Illidium-Q36: benc$ tree -a
.
├── .classpath
├── .project
├── .settings
│   └── org.eclipse.jdt.core.prefs
├── bin
│   └── HelloWorld.class
└── src
 └── HelloWorld.java

3 directories, 5 files

Initializing Source Control

If you plan on utilizing a remote repository service such as Github, Bitbucket or Gitlab I recommend that you instead of creating a repository locally as described below you create the remote repository first and then clone it to your local machine. How to do this is explained in section “To create a remote repository at Github” found at https://illidiumq36.wordpress.com/2019/08/19/using-github-to-hand-in-exercises-and-labs-or-sharing-your-code-with-teammates-or-the-world/

Please note that when cloning a repository created via Github the main branch created is named 'main' and not 'master' as is the case if you create the repository via git init.

So the folder illustrated above would be the place we would like to place under version control. To do that using git we run the command ‘git init‘:

Illidium-Q36: benc$ git init
Initialized empty Git repository in /Users/benc/eclipse/workspace-folder/source-code-management-101/.git/

Now we have created an empty git repository in the same location that our IDE uses to save all our files. A git repository is a place where the history of your work is stored. It often lives in a .git subdirectory of your working directory. You can actually see this folder in the ‘git init‘ command output above.

Placing files under version control

The next step is to add all the files we would like git to version control for us, we want to place our files under version control. When using git this is a two step process. Step one is adding the files to git and step two is commiting them to git. This is illustrated below, where all our files initially are not added to git, then they are added and lastly they are committed. I use the command ‘git status‘ to check the current state of our git repository for each state change made in the repo:

Illidium-Q36: benc$ git status
On branch master

Initial commit

Untracked files:
 (use "git add <file>..." to include in what will be committed)

.classpath
 .project
 .settings/
 src/

nothing added to commit but untracked files present (use "git add" to track)
Illidium-Q36: benc$ git add .
Illidium-Q36: benc$ git status
On branch master

Initial commit

Changes to be committed:
 (use "git rm --cached <file>..." to unstage)

new file: .classpath
 new file: .project
 new file: .settings/org.eclipse.jdt.core.prefs
 new file: src/HelloWorld.java

Illidium-Q36: benc$ git commit -m "Initial commit, HelloWorld class created."
[master (root-commit) afcfe80] Initial commit, HelloWorld class created.
 4 files changed, 43 insertions(+)
 create mode 100644 .classpath
 create mode 100644 .project
 create mode 100644 .settings/org.eclipse.jdt.core.prefs
 create mode 100644 src/HelloWorld.java
Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean

Adding file changes to version control

Now we have added all our files to version control and the state the files are in right now are saved and in the future viewable and even revert-able if needed.
So now assume that we want to do some changes to our source code.

We start a coding session and generate some changes and some new code in our project.
Screen Shot 2017-04-23 at 16.48.50As we have placed our project under version control, git now recognize this and if we do a ‘git status‘ we will see that:

Illidium-Q36: benc$ git status
On branch master
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git checkout -- <file>..." to discard changes in working directory)

modified: src/HelloWorld.java

no changes added to commit (use "git add" and/or "git commit -a")

So now we need to repeat the process of adding these changes to git and then commit them to the repository. Again I use the command ‘git status‘ to illustrate the change in state in our git repository.

Illidium-Q36: benc$ git add .
Illidium-Q36: benc$ git status
On branch master
Changes to be committed:
 (use "git reset HEAD <file>..." to unstage)

modified: src/HelloWorld.java

Illidium-Q36: benc$ git commit -m "Created a printMessage method that accepts a String and prints it."
[master 58286f4] Created a printMessage method that accepts a String and prints it.
 1 file changed, 4 insertions(+), 1 deletion(-)
Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean

Viewing the history of our source code

So now we have two commits made in our repository (two points in time for our files). We can illustrate this by using the command ‘git log‘. This command will show us the entire repository history from latest to earliest commit:

Illidium-Q36: benc$ git log
commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.

In gitlingo the latest commit is called “HEAD” and you can always use the word “HEAD” to refer to your latest commit. Also note that each commit has a hashed string, this is the commits unique identifier in the git repository and can always be used to look at or revert to a specific commit (point in time) for your file. Observe that you do not see the actual content of the files instead you see the commit message you give when committing. It is therefore a very very good habit to write a descriptive commit message for each of your commits. If it is good enough you can based on that choose which point in time you would like to look at or even revert your source code to.

Looking at/working with files from a specific point in time

You can always look at files from any commit at any time using git. There is however two things you should be aware of if you want to change the point in time you currently are looking at. Firstly you should ONLY do that when your working directory is clean. If you have changes not added to version control and want to look at another point in time, git will inform you of this and tell you to decide to either stash the or abandon the changes currently made. Git stashing is not a part of this inital workflow so therefore you need to have a clean working directory when you want to move to a different point in time for your files. You achieve that by either doing a

  •  ‘git add .‘ followed by a ‘git commit -m “message here”‘. This means you add the current state of your files to your git-repo or you do a,
  •  ‘git checkout — src/HelloWorld.java‘. This means that you abandon the changes you made to the file and you revert to the latest committed point in time for the file (HEAD).

With a clean working directory you can now move to a different point in time by using the command ‘git checkout name_of_commit‘.

Secondly, moving to a specific point in time in a git repository means that you leave the current ‘branch‘ in your repository and you need to move back to the branch you left when you want to continue working. Branch is gitlingo for a specific track of “point in times”. You can have several branches in one git repository where each branch reflects a unique set of file contents and a unique set of “points in time”.

Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean
Illidium-Q36: benc$ git log
commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.
Illidium-Q36: benc$ git checkout afcf
Note: checking out 'afcf'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

git checkout -b <new-branch-name>

HEAD is now at afcfe80... Initial commit, HelloWorld class created.

As you can see in our IDE the source code is changed to the point in time for the initial commit:

Screen Shot 2017-04-22 at 16.44.03If we want to move back to where we were and continue working with our source code we do a new ‘git checkout‘ this time we need to move back to our only branch ‘master’

Illidium-Q36: benc$ git status
HEAD detached at afcfe80
nothing to commit, working tree clean
Illidium-Q36: benc$ git checkout master
Previous HEAD position was afcfe80... Initial commit, HelloWorld class created.
Switched to branch 'master'
Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean
Illidium-Q36: benc$ git log
commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.

And now we are back and continue developing our source code and place the changes under source control.

Screen Shot 2017-04-23 at 16.48.50
Undoing changes

Reverting to a previous point in time for our source code

When you have created different states in time (commits) for your files it is not very easy to remove these changes, and I think it should not be easy, the point of committing is that the states are kept. You should not think of your different commits in terms of undoing or deleting them instead what you should do is think of them as potential points in time to move back to or even better potential point in time to revert to a new HEAD. In gitlingo this means that you want to ‘revert‘ back to a previous point in time and making that point in time the current (latest) point in time. In this process you want to revert all changes made to recreate the state of the files for that point of time you want to go back to.

You should only do this when your working directory is clean. And by reverting you can actually always go back to the state you had before you decided to use another point in time. If we actually deleted a commit we would not be able to do that. So imagine we want to go back to the state of our files we had in the first commit we made we would do that using the command ‘git revert‘.

Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean
Illidium-Q36: benc$ git log
commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.
Illidium-Q36: benc$ git revert --no-commit afcf..HEAD
Illidium-Q36: benc$ git status
On branch master
You are currently reverting commit 58286f4.
 (all conflicts fixed: run "git revert --continue")
 (use "git revert --abort" to cancel the revert operation)

Changes to be committed:
 (use "git reset HEAD <file>..." to unstage)

modified: src/HelloWorld.java

Now as we can see git instructs us to run an additional ‘git revert‘ command to complete the revert so we do that:

Illidium-Q36: benc$ git revert --continue
[master cce58b1] Revert "Created a printMessage method that accepts a String and prints it."
 1 file changed, 1 insertion(+), 4 deletions(-)
Illidium-Q36: benc$ git log
commit cce58b17dbfde586f5f2bca509116bd52ee014c9
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 14:19:43 2017 +0200

Revert "Created a printMessage method that accepts a String and prints it."
 
 This reverts commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf.

commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.

As you can see we have actually recorded a new point in time (a new commit) representing the “going from the current point of time back to a previous point in time”. This means that we can revert the revert if we want to. The point is that we do not remove changes made to our version controlled source code, we revert back to them if we need to, hence keeping everything in our history.

The state of our source code is now:
Screen Shot 2017-04-22 at 16.43.05
And we have a new commit to revert to if needed.

Deleting unstaged changes to working directory

This means that we have made changes to our source controlled files but we have not added them to our git repository and we want to delete the changes we made and go back to HEAD (latest point in time). We do that by running the command ‘git checkout — filename-with-changes-to-undo‘
So imagine we write some code and realise that this is not any good and we want to remove it completely and go back to the state we hade previously we do that like this:

Illidium-Q36: benc$ git status
On branch master
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git checkout -- <file>..." to discard changes in working directory)

modified: src/HelloWorld.java

no changes added to commit (use "git add" and/or "git commit -a")
Illidium-Q36: benc$ git status
On branch master
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git checkout -- <file>..." to discard changes in working directory)

modified: src/HelloWorld.java

no changes added to commit (use "git add" and/or "git commit -a")
Illidium-Q36: benc$ git checkout -- src/HelloWorld.java 
Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean

Now we are back at the latest committed point in time for our source code.

Deleting staged changes

This means that we have made changes to our source controlled files and added them for source control but we have not yet committed them and we want to delete the changes we made and go back to HEAD (latest point in time). We do that by running the command ‘git reset –hard head‘

NOTE: git reset is a dangerous command that actually lets you delete points in time in your git repo.

So imagine we write some code add the changes to source control and realise that this is not any good and we want to remove it completely and go back to the state we hade previously we do that like this:

Illidium-Q36: benc$ git status
On branch master
Changes not staged for commit:
 (use "git add <file>..." to update what will be committed)
 (use "git checkout -- <file>..." to discard changes in working directory)

modified: src/HelloWorld.java

no changes added to commit (use "git add" and/or "git commit -a")
Illidium-Q36: benc$ git add .
Illidium-Q36: benc$ git status
On branch master
Changes to be committed:
 (use "git reset HEAD <file>..." to unstage)

modified: src/HelloWorld.java

Illidium-Q36: benc$ git reset --hard head
HEAD is now at cce58b1 Revert "Created a printMessage method that accepts a String and prints it."
Illidium-Q36: benc$ git status
On branch master
nothing to commit, working tree clean

And now the changes we made and added to source control are removed and we are back at the latest point in time for our source code.

Comparing source code at different point in time

When files are placed under source control it is usually very easy to compare the files from different point in time. This is called diffing to do that using git you use the command ‘git diff‘ and provide the two commits you want to compare:

Illidium-Q36: benc$ git log
commit cce58b17dbfde586f5f2bca509116bd52ee014c9
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 14:19:43 2017 +0200

Revert "Created a printMessage method that accepts a String and prints it."
 
 This reverts commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf.

commit 58286f4146349fe2d889f90f3b5a4b7a724f2cdf
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:20:57 2017 +0200

Created a printMessage method that accepts a String and prints it.

commit afcfe80967a0431152f7fbb7640e77bc5f50014b
Author: benc <benc@redpill-linpro.com>
Date: Sun Apr 23 13:11:13 2017 +0200

Initial commit, HelloWorld class created.
Illidium-Q36: benc$ git diff 5828 afcf
diff --git a/src/HelloWorld.java b/src/HelloWorld.java
index 61a0c5a..d9511f1 100644
--- a/src/HelloWorld.java
+++ b/src/HelloWorld.java
@@ -3,10 +3,7 @@ public class HelloWorld {
 
 public static void main(String[] args) {
 // TODO Auto-generated method stub
- printMessage("Hello Source-code management World!");
- }
- public static void printMessage(String m) {
- System.out.println(m);
+ System.out.println("Hello Source-code management World!");
 }
 }

The command only shows differences and not similarities so everything not listed here is exactly the same in the both commits, except a couple of lines before and and after the differences, to enhance readability. A minus sign indicates a row existing in the first commit and missing in the latter. A plus sign indicates the lack of the row in the first commit and the existence of the row in the latter.

Workflow summary

This very simple solo developer workflow is based on no previous version control experience and specifically no previous git experience. To work efficiently I recommend frequent commits. You can not do too many commits just too few. I recommend that you do a commit each time you stop typing source code. You can even streamline the ‘git add .‘ and ‘git commit -m “message here”‘ to just one command ‘git commit -am “message here”‘ using this command will however disable your ability to delete staged changes. You would always need to do a ‘git revert‘ instead.
Natural next steps from here is to include a remote repository location for proper backups and also include branching if you want to do multi-developer projects.

Posted in Tooling | 3 Comments

PresenterConsole the missing hammer in my toolbox

I do a lot of presentations and I live and breathe slides. I have for a long time used OpenOffice and lately LibreOffice as I prefer Open Sourced solutions to proprietary ones. So what I’m on a mac :). But lately I have been getting into mysterious bugs with large presentations 200 slides and up. And I am finding myself spending hours in having to reformat and reformat the slidedecks as strange formatting occurs. I have also discovered that odp-files are very sensitive when sharing. It seems that stuff from every users environment seeps into the deck which makes it harder and harder to maintain. To handle this I have been exploring alternatives like Latex (beamer), asciidoc (slidy) and Restructured text (rst2pdf). All these tools can be used to create predictable outcome in terms of either html-slides or pdf-slides. Still I keep coming back to Impress and you may wonder why? Well here you have it: the presenter console:

https://i0.wp.com/www.12robots.com/images/screen_2_2.png

I find this very useful as it helps me keep track on:

  • Time.
  • Next slide.
  • Notes.
  • Current location in the deck.
  • I also like the fact that the actual notes are stored in the same document as the source to the note.

I have been looking around for quite some time trying to locate a tool that can do the same for pdf-presentations or html-presentations. I can not find it. The tools I do find are always lacking some of the very few requirements I have.


The solution

I decided to build a working prototype of the necessary tools myself. As I work with Java all day long I decided to go with a Java project. I needed something that could handle pdf-viewing in a flexible way and located ICEpdf. ICEpdf is an Open Source Licensed Java based pdf engine created by ICESoft. Basically ICEpdf does all the heavy lifting and all I needed to do is to include 2 jars in the PresenterConsole. So thanks a bunch ICESoft!  I realised that the solution needs to come in two parts:

  1. The Builder tool that creates the necessary documents for notes and presentation
  2. The PresenterConsole that displays all the stuff I require.

I realised that I could fix the builder tool just by creating a bash script with some usage of:

* sed
* gsed (gnu sed for handling escaping correctly on mac.) 
* rst2pdf.

Basically I installed gsed and rst2pdf using Macports.
I am no bash-ninja so there are probably a lot of possible improvements on the build-script, maybe someone even could create a one liner out of the whole thing. You can check it out here: https://bitbucket.org/bennchri/presenterbuilder. Also this is using Restructured Text and rst2pdf for the slide creation, but this is fairly easy to tweak to use whatever build-setup able of producing pdfs.

The PresenterConsole is located in another repo: https://bitbucket.org/bennchri/presenterconsole.

Screenshots

And the end result looks like this:

Screenshot of the presentation (on the projector or what not)

https://i0.wp.com/img.ctrlv.in/img/525964541ad06.png

Screenshot of the presentation console

https://i0.wp.com/img.ctrlv.in/img/525963e3b1642.png
Posted in Tooling | Leave a comment

Diff openoffice files using git

Everybody that committed an openoffice document to git repo and then tried to git diff it to see changes knows that you only will get the not very useful output of:

Binary files "a/overview.ods" and "b/overview.ods" differ

If you would like to get a little more informative response when diffing openoffice document you could do these steps:


Step 1 Install odt2txt

Download and install the odt2txt converter on your system [http://stosberg.net/odt2txt/]

Tip If you are on a mac there is a port for this (requires macport)
port install odt2txt

Step 2 Associate filetypes to a specific diff-tool

Create a file called .gitattributes in your git repo root and add the following lines to it:

*.ods diff=odf
*.odt diff=odf
*.odp diff=odf

Step 3 Define the diff-tool

Run the command:

git config --global diff.odf.textconv "odt2txt"

This will update your ~/.gitconfig file with the following stanza:

[diff "odf"]
        textconv = odt2txt

Enjoy diffing openoffice files

diff --git a/deck.odp b/deck.odp
index ec5eeb2..9b543bd 100644
--- a/deck.odp
+++ b/deck.odp
@@ -7,11 +7,11 @@

   diff

-  more
-
-  than
+  as

   you
Posted in Tooling | Leave a comment

Global .gitignore and how to make it stick

I always seem to forget to add a .gitignore file in my git repos when I initialize a new one. Usually I do not notice all the pesky DS_Store and whatnot until I am browsing my source in a remote repo like Github or Bitbucket. And then atleast for me not being a Git-ninja it is too late to get them ignored. Once git started tracking something its like it will never ever ever ever forget it.

So to make my life a little simpler I set up a global .gitignore file and placed in my home catalog I found sources saying I need to call it .gitignore_global so thats what I did I also filled the bad boy up with the following content:


.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

Looks good right? Well what wasn’t quite as obvious is that I also needs to tell git to use the file. That is done with the command:

 git config –global core.excludesfile ~/.gitignore_global 

And now finally I can forget to set up a .gitignore at least until I find out I should have had some other file types ignored as well.

Posted in Tooling | Leave a comment

Blog using Asciidoc

So today I started using the phenomenal blogpost CLI-application called “blogpost” created by Stuart Rackham (he is also the author of Asciidoc which I recently started using and find that I’m soon using for EVERYTHING! You can find more info on Asciidoc at: http://asciidoc.org/

So besides creating Asciidoc he also created the blogposting tool you can use to write your blog entry in your favourite editor instead of using the not so superior online editor provided in WordPress. Don’t get me wrong the editor in WordPress is definetly not poorer than any other online editor but rather the opposite it is actually one of the better ones i’ve used. But comparing this to writing using your own tools of course no online editor can compete (customization, screen usage, versioning etc.). Of course the blogposting tool utilizes Asciidoc and enables you to send/update/delete/check blog entries to/in your wordpress blog from the commandline.

You can read more regarding installation and usage here:

But just to provide the gist this is the process I use:

  • Write the blog entry locally (using Asciidoc notation)
  • Publish blogpost using command:
/path/to/blogpost.py post blogentryname.txt
  • If I need to update the entry, I just rewrite and republish
  • If I want to place the entry in a specific category I add the switch -c like:
/path/to/blogpost.py post -c'Tooling' blogentryname.txt
this entry would end up in the "Tooling" category.
  • To see what you can do with the tool invoke a:
/path/to/blogpost/blogpost.py --help
Posted in Tooling | Leave a comment

Creating a Pull Request on Github

So you have cloned your favourite project off Github and done some really nice improvements in your local copy. They are well tested and now you want to contribute these improvements to the community/project. You try and do a

  git push origin mybranch

just to realize that your push is not accepted as you do not have the rights to push to the repo. If you think about it for 2 seconds you realize why. If the original project allowed “anyone” to push changes to their repo it would not take long until it wasn’t their repo anymore. To maintain control over the codebase they can not allow “anyone” pushing “anything” into their repo.

OK so you still think your contributions would be worth something and you still want to contribute, well lucky you are using git and Github. What you do is to issue a “Pull Request” to the original project telling them that “Hey people I have made some good contributions here, please check them out and if you like them feel free to merge them into your codebase (or not). A “Pull Request” is defined as:

‘Pull requests let you tell others about changes you’ve pushed to a GitHub repository. Once a pull request is sent, interested parties can review the set of changes, discuss potential modifications, and even push follow-up commits if necessary.‘(https://help.github.com/articles/using-pull-requests)

The thing with pull requests on Github is that they can only be issued from one Github repo to another Github repo. So your local git clone, where you done all the work, will not be enough to issue a pull request. Enter the Fork. A Fork in Github lingo means a clone of a Github repo on Github. From a fork you have the possibility to issue a pull request. So basically what you need to do is the following:

Step 1. Fork the repo :http://note.io/XDnaJg

Step 2. Clone the repo

git clone forkrepoaddress

Note

You could of course retrofit your existing local clone to the remote fork by doing some Git ninja magic like: git remote add origin <remote_repo_url>

Step 3. Do your changes Work and commit in the local repo.

Step 4. Push to fork When ready to share your contributions:

git push origin branchname

Step 5. Create the Pull request :https://github-images.s3.amazonaws.com/help/pull-request.png

And now the original project will get an indication that you created a pull request. They can check it out and if they want it (or parts of it) they can merge it into their codebase in a controled manner.

Posted in Tooling | Leave a comment

Setting up a Virtualbox guest running Android x86 and using it as test platform fom Eclipse + ADT

Using the recommended approach (Android SDK, Eclipse and the ADT plugin) as described at http://developer.android.com/sdk/installing.html represent a very nice toolchain for Android development. The only thing that bugs me is the very slow startup and installation of the Emulator (the AVD). Don’t get me wrong I’m totally aware of all the stuff that goes on when creating and starting up an AVD and I appreciate the niftyness in the solution. It works very well. Also as soon as the device is running you can hot redeploy your apps to it which removes a big chunk of the turnaround time.

So if you like to use another alternative (and I don’t mean the obvious one of using a real device) you could try setting up an Android-x86 guest in Virtualbox and then add that virtualbox to your AVD manager to get Eclipse to install/reinstall (hot redeploy) to it. I found a blogpost that described the process in a usable and instructive way, thanks to Randall A. Gordon. So basically just follow the steps he assembled. In addition to get the network working properly I suggest you choose a triple e version of android (I am using android-x86-2.3-RC1-eeepc.iso in my setup). You find the HOW-TO here: http://androidspin.com/2011/01/24/howto-install-android-x86-2-2-in-virtualbox/

After installation tweaks:

To get the pointer rolling in the Android Guest OS you need to disconnect the mouse (disable mouse integration) you do that by clicking inside the Android Guest and then hit the keys [Cmd]-i (needs to be the left Cmd key if you use mac and use the defaults in Virtualbox).

To get the network going you need to stop the Android guest (if running). Change the settings for the network to “NAT”.

Choose Adapter Type “PCnet – FAST III”, select Cable “connected”

To get the possibility to deploy from Eclipse to the device you need to enable port forwarding on port 5555. So turn off the Android guest, fire up a terminal and run the following command:

$ VBoxManage modifyvm <name_of_your_android_vm> --natpf1 adb,tcp,*,5555,*,5555

next step is to head on over where you installed the Android SDK and locate the platform tools folder:

├── add-ons
├── platform-tools
│   ├── NOTICE.txt
│   ├── aapt
│   ├── adb
│   ├── aidl
│   ├── api
│   ├── dexdump
│   ├── dx
│   ├── fastboot
│   ├── lib
│   ├── llvm-rs-cc
│   ├── renderscript
│   └── source.properties
├── platforms
│   ├── android-10
│   ├── android-14
│   ├── android-15
│   └── android-7
├── system-images
│   └── android-14

To connect the Android guest as a device you need to have the Android guest running in Virtualbox then run the following command from the platform-tools folder:

./adb connect localhost:5555

The last thing you need to do to deploy automatically when running an Android app from Eclipse is to set up the device as the one recieving the app. You do that by tweaking the “Run Configuration” you use in Eclipse like so:

So now when you hit the run button you will get the option to choose which device the app shoul be deployed to. Choose the localhost:5555 device:

Posted in Android | 1 Comment