How can I show NSLogs from apportable android emulator in console?

76 Views Asked by At

I am running my app which I ported using apportable (on Mac) on an android emulator. I know that NSLogs can be logged when using apportable on a physical device using the following command.

apportable log | grep AppName

I would like to log the NSLogs in the console when running the app on the emulator.

1

There are 1 best solutions below

0
Mike On

The command you listed:

apportable log | grep AppName

works for both physical devices and for the emulator for me.

Here are some of the causes I have run into when using apportable and the android emulator:

  1. In theory you can support multiple devices simultaneously, but sometimes I have noticed that you need to restart the android debug bridge when moving between a physical device and the emulator:
adb kill-server
adb start-server
  1. Occasionally, repeated app installations or debugging seasons throw the emulator into a confused state and I rebuild it via:
rm -r ~/.android/avd/AVD*
android avd # Run the virtual device manager and recreate a virtual device from a device definition
emulator -avd virtual-device-name -shell # NB: first run after a rebuild takes longer - should wait before attempting "apportable debug" or "apportable install"
adb logcat # or apportable log
  1. I also like to clean the apportable device cache after an emulator rebuild or when swapping devices via:
apportable clean_device_cache