(This is an enhancement request) I think the emulator would need to handle a /shutdown request and then you could do something very similar to what the datastore does. Then tests can start/stop it without needing to run the emulator 1st. See https://github.com/GoogleCloudPlatform/google-cloud-java/blob/1c456ead3455680ef198900712ff481d634ec530/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java
(This is an enhancement request)
I think the emulator would need to handle a /shutdown request and then you could do something very similar to what the datastore does.
Then tests can start/stop it without needing to run the emulator 1st.
See https://github.com/GoogleCloudPlatform/google-cloud-java/blob/1c456ead3455680ef198900712ff481d634ec530/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing/LocalDatastoreHelper.java