Android Emulation Testbed Tutorial (1)
Transcript of Android Emulation Testbed Tutorial (1)
Introduction
CORE:1 convenient, easy-to-use emulatorUses lightweight virtual machines (Linux namespaces)
Can run real applications
CORE allows access to physical hardware through their RJ45 tool
Most Android devices support USB tethering
Combine the two to run real Android applications over emulated network
1http://cs.itd.nrl.navy.mil/work/core/
CORE & Android Integration 2/8
Requirements
Android device with USB tethering capabilityIf disabled by a carrier, could use a third-party ROM
Cyanogenmod2 is a popular ROM which enables USB tethering
Android SDK with adb for executing shell commands on deviceI Other methods such as manually running commmands in terminal
emulator on deviceI
adb is easier
Tested Devices:Samsung Nexus S, Cyanogenmod 7.1, Android 2.3.3
LG Optimus V, Cyanogenmod 7.1, Android 2.3.3
ASUS EEE Pad Transformer, Android 4.0.3
A Linux machine with CORE installedArch Linux, Kernel 3.2.9
CORE version 4.32http://www.cyanogenmod.com/
CORE & Android Integration 3/8
Android SetupFirst, connect the device to a Linuxmachine, then:1. Open the main settings menu
2. Select “Wireless & networks”
3. Select “Tethering & portablehotspot”
4. Make sure “USB tethering” isenabled
5. On host machine, run “adbshell ifconfig usb0
<ipaddress> <netmask>”I Probably “10.0.0.100
255.255.255.255”I On some devices, usb0 is
named rndis0.
CORE & Android Integration 4/8
Android SetupFirst, connect the device to a Linuxmachine, then:1. Open the main settings menu
2. Select “Wireless & networks”
3. Select “Tethering & portablehotspot”
4. Make sure “USB tethering” isenabled
5. On host machine, run “adbshell ifconfig usb0
<ipaddress> <netmask>”I Probably “10.0.0.100
255.255.255.255”I On some devices, usb0 is
named rndis0.
CORE & Android Integration 4/8
Android SetupFirst, connect the device to a Linuxmachine, then:1. Open the main settings menu
2. Select “Wireless & networks”
3. Select “Tethering & portablehotspot”
4. Make sure “USB tethering” isenabled
5. On host machine, run “adbshell ifconfig usb0
<ipaddress> <netmask>”I Probably “10.0.0.100
255.255.255.255”I On some devices, usb0 is
named rndis0.
CORE & Android Integration 4/8
Android SetupFirst, connect the device to a Linuxmachine, then:1. Open the main settings menu
2. Select “Wireless & networks”
3. Select “Tethering & portablehotspot”
4. Make sure “USB tethering” isenabled
5. On host machine, run “adbshell ifconfig usb0
<ipaddress> <netmask>”I Probably “10.0.0.100
255.255.255.255”I On some devices, usb0 is
named rndis0.
CORE & Android Integration 4/8
USB Tethering: CORE SetupMake sure the CORE daemon isrunning, and start the CORE GUI1. Create a new emulation
2. Drag some emulated nodes intothe network
3. Create an “RJ45” node
4. Double click on the “RJ45” nodeto configure it, choose theinterface created by thetethering.
I Some devices seem to createtwo interfaces when tethering.Unfortunately both need to betried.
CORE & Android Integration 5/8
USB Tethering: CORE SetupMake sure the CORE daemon isrunning, and start the CORE GUI1. Create a new emulation
2. Drag some emulated nodes intothe network
3. Create an “RJ45” node
4. Double click on the “RJ45” nodeto configure it, choose theinterface created by thetethering.
I Some devices seem to createtwo interfaces when tethering.Unfortunately both need to betried.
CORE & Android Integration 5/8
USB Tethering: CORE SetupMake sure the CORE daemon isrunning, and start the CORE GUI1. Create a new emulation
2. Drag some emulated nodes intothe network
3. Create an “RJ45” node
4. Double click on the “RJ45” nodeto configure it, choose theinterface created by thetethering.
I Some devices seem to createtwo interfaces when tethering.Unfortunately both need to betried.
CORE & Android Integration 5/8
USB Tethering: CORE SetupMake sure the CORE daemon isrunning, and start the CORE GUI1. Create a new emulation
2. Drag some emulated nodes intothe network
3. Create an “RJ45” node
4. Double click on the “RJ45” nodeto configure it, choose theinterface created by thetethering.
I Some devices seem to createtwo interfaces when tethering.Unfortunately both need to betried.
CORE & Android Integration 5/8
USB Tethering: CORE Setup continued
5. Create a “wireless LAN” nodechoose the interface created bythe tethering.
6. Double click the WLAN node toconfigure it.
7. Set the “IPv4 subnet” to thesame subnet as your Androiddevice.
8. Click “Link to all routers”
9. Use the link tool and drag fromthe WLAN node to the RJ45node to add it to the wirelessnetwork.
CORE & Android Integration 6/8
USB Tethering: CORE Setup continued
5. Create a “wireless LAN” nodechoose the interface created bythe tethering.
6. Double click the WLAN node toconfigure it.
7. Set the “IPv4 subnet” to thesame subnet as your Androiddevice.
8. Click “Link to all routers”
9. Use the link tool and drag fromthe WLAN node to the RJ45node to add it to the wirelessnetwork.
CORE & Android Integration 6/8
USB Tethering: CORE Setup continued
5. Create a “wireless LAN” nodechoose the interface created bythe tethering.
6. Double click the WLAN node toconfigure it.
7. Set the “IPv4 subnet” to thesame subnet as your Androiddevice.
8. Click “Link to all routers”
9. Use the link tool and drag fromthe WLAN node to the RJ45node to add it to the wirelessnetwork.
CORE & Android Integration 6/8
USB Tethering: CORE Setup continued
5. Create a “wireless LAN” nodechoose the interface created bythe tethering.
6. Double click the WLAN node toconfigure it.
7. Set the “IPv4 subnet” to thesame subnet as your Androiddevice.
8. Click “Link to all routers”
9. Use the link tool and drag fromthe WLAN node to the RJ45node to add it to the wirelessnetwork.
CORE & Android Integration 6/8
USB Tethering: CORE Setup continued
5. Create a “wireless LAN” nodechoose the interface created bythe tethering.
6. Double click the WLAN node toconfigure it.
7. Set the “IPv4 subnet” to thesame subnet as your Androiddevice.
8. Click “Link to all routers”
9. Use the link tool and drag fromthe WLAN node to the RJ45node to add it to the wirelessnetwork.
CORE & Android Integration 6/8
USB Tethering: CORE Setup continued 2
10. Click on the “Start Experiment”button.
11. Run any applications/routingprotocols necessary
CORE & Android Integration 7/8
USB Tethering: CORE Setup continued 2
10. Click on the “Start Experiment”button.
11. Run any applications/routingprotocols necessary
CORE & Android Integration 7/8
Notes
Doesn’t matter what IP address the tethered interface has in LinuxCORE opens the device in promiscuous mode
Some Android devices create two Linux network devices when tethered.For example, the LG Optimus V
One device won’t work, the other will
Just need to try both devices
Some Android devices have rndis0 instead of usb0Both act the same way
If tethering is not supported, could connect to wireless APInstead of tethering, use a USB WiFi card to create a wireless accesspoint
One AP for each device
The rest of the process is the same, use the wlan device in CORE
CORE & Android Integration 8/8