Running emulator and phone simultaneously

When I am developing I often have the need to run something on the phone and the emulator. Due to the long startup time on the emulator I don't want to shut this down whenever I connect the phone. My preferred way to view logs is using a bash shell with the adb logcat command. This however will not produce the desired output when the 2 platforms are running together. Instead the -s for serial number switch must be provided. The format is adb -s emulator-5554 logcat
I had previously tried adb logcat -s emulator-5554 which does not work. The adb program gets the logcat param before it sees the switch and you just get a normal log tail. This is a trivial post, but is very handy now that I have figured this out :)
To get the list of devices (ie. your phone and emulator serial numbers in this case) enter adb devices at the command prompt.

Comments

Popular posts from this blog

Building a choropleth map for Irish agricultural data

Early Stopping with Keras

AutoCompleteTextView backed with data from SQLite in Android