Can I use the AVD in another computer to test App? Of course!
1. Install the Android SDK on the "remote computer"
Refer to the document, "HOWTO Setup Android Development", to install the Android SDK in another fast Linux computer.2. Establish the "terminal" connection between "Local Computer" and "remote computer"
Use SSH to establish the link between the "local computer" and "remote computer". The command in the "Termial" is[SiB@Celeron-D ~]$ ssh 192.168.10.17 -p 2012 -L 5555:127.0.0.1:5555 -Xwhere "192.168.10.170" is the network address of the "remote computer", "2012" is a "remote computer" in the SSH port number and two "5555" are the AVD corresponding port number for the "local computer" and "remote computer". The parameter "-X" is more important. It will redirect the screen of AVD running on the "remote computer" to "local computer".
When the connection is successful, the Terminal command prompt will change as "remote computer" prompt text.
[SiB@Celeron-D ~]$ ssh 192.168.10.17 -p 2012 -L 5555:127.0.0.1:5555 -X SiB@192.168.10.17's password: Last login: Sat Aug 11 12:32:21 2012 from 192.168.10.12 [SiB@Core-i7 ~]$In this example, the "Terminal" screen contains the command prompts of the two computers: "local computer" for "[SiB@Celeron-D ~]" and "remote computer" for "[SiB@Core-i7 ~]".
3. Start the AVD in "remote computer"
Before start the AVD in "remote computer", we test the AVD connection status of ADB in "local computer" firstly.[SiB@Celeron-D ~]$ Android-SDK/platform-tools/adb devices * daemon not running. starting it now on port 5037 * * daemon started successfully * List of devices attachedSure there are no any the AVD connection. Then, start the AVD in the "remote computer", it can only use the command mode,
[SiB@Core-i7 ~]$ Android-SDK/tools/emulator -avd Android_2.2 Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. emulator: warning: opening audio output failedThese "warning messages" do not affect the subsequent operation. Then, the familiar picture is appeared.
Of course, it is shown on the screen in "local computer".
4. Use the ADB in "local computer" to connect AVD
Then test the AVD connection status of ADB in the "local computer".[SiB@Celeron-D ~]$ Android-SDK/platform-tools/adb devices List of devices attachedStrange! Does not the AVD in "remote computer" have been started and the screen have been redirected to the "local computer"? It is not enough.
The ADB in "local computer" must be restarted to search for the network-connected AVD again.
[SiB@Celeron-D ~]$ Android-SDK/platform-tools/adb kill-server [SiB@Celeron-D ~]$ Android-SDK/platform-tools/adb start-server * daemon not running. starting it now on port 5037 * * daemon started successfully *This means that the ADB in "local computer" is restarted successful. Then, the AVD connection status of the ADB in "local computer" is tested again.
[SiB@Celeron-D ~]$ Android-SDK/platform-tools/adb devices List of devices attached emulator-5554 deviceThe screen shows the detected AVD and the connection message. Of course, the AVD is running in the remote computer.
5. Test and debug the App using the AVD in the "remote computer"
Finally, we don't need replace the preferred computer, and continue to enjoy the fun of the development.Tested version:
- Fedora: 14, 17
No comments:
Post a Comment