INACTIVE - http://mzl.la/ghe-archive - C++ version of the Android Java SUTAgent
Перейти к файлу
Syd Polk c53b95d2ec Make NSPR installation relocatable on Mac. 2016-01-22 15:11:10 -05:00
libs Bug 852253 - Include prebuilt static nspr libs. r=ted 2013-04-03 10:51:01 -04:00
src Merge pull request #13 from luser/mac-fixup 2014-06-25 20:21:28 -04:00
.gitignore Add compiler-generated Makefile dependencies 2014-06-12 21:04:57 -04:00
Android.mk Bug 852253 - Include prebuilt static nspr libs. r=ted 2013-04-03 10:51:01 -04:00
Makefile Add compiler-generated Makefile dependencies 2014-06-12 21:04:57 -04:00
Makefile.common Add compiler-generated Makefile dependencies 2014-06-12 21:04:57 -04:00
Makefile.droid Bug 852253 - Include prebuilt static nspr libs. r=ted 2013-04-03 10:51:01 -04:00
Makefile.linux Fix a few review comments 2014-06-11 13:16:25 -04:00
Makefile.macosx Make NSPR installation relocatable on Mac. 2016-01-22 15:11:10 -05:00
Makefile.win Implement setDefaultTestRoot properly, and fileHash using Windows crypto APIs 2014-06-10 21:49:58 -04:00
README.md fix README 2014-06-10 13:24:48 -04:00
bootstrap.sh do not reinstall toolchain everytime 2012-08-20 14:05:53 -07:00
run.sh s/ADB/ADB_PATH to be consistent with the other codebases 2012-09-13 16:50:46 -07:00
setup-tools.sh s/ADB/ADB_PATH in setup-tools 2012-09-14 16:59:35 -07:00

README.md

Prerequisites - Android

You need to:

  • have the Android NDK:

  • have the NSPR headers installed under /usr/include/nspr:

  • export these vars:

    • NDKPATH = path to the NDK folder
    • ADB_PATH = path to the adb binary
  • have a running B2G emulator/device with the ports 20700 and 20701 forwarded:

    • adb forward tcp:20700 tcp:20700
    • adb forward tcp:20701 tcp:20701
  • install busybox on the device:

    • ./setup-tools.sh
  • have the toolchain:

    • source bootstrap.sh

Building, running

Just ./run.sh.

Including this in B2G

Once you have the prerequisites and export the environment variables, just clone this repo inside $B2G_REPO/system/. Build and flash B2G as usual. You will be able to run the agent using sutagent. It will be in the $PATH.

You do need to set the LD path for this to work:

export LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/b2g

Start the agent on boot

Insert this after the exports in $B2G_REPO/gonk-misc/b2g.sh:

export NSPR_LOG_MODULES="NegatusLOG:5, timestamp"
sutagent &

NSPR Logging

Before running the agent (not necessary if you use run.sh):

export NSPR_LOG_MODULES="NegatusLOG:5, timestamp"

Data will be logged to $TESTROOT/Negatus.log.

Prerequisites - Desktop Linux

The linux build requires the nspr libraries and headers. On Ubuntu, you can do

sudo apt-get install g++ libnspr4-dev

Build with:

make -f Makefile.linux

Invoke with:

./agent

Prerequisites - Mac OS X

You need to have the latest version of Xcode (available from the App Store) and the command line developer tools packages installed. You will have to build your own nspr Mac installation, available at https://ftp.mozilla.org/pub/mozilla.org/nspr/releases/.

The default nspr build installs nspr to /usr/local; the Mac Makefile assumes that you have done that. To build Negatus, do:

make -f Makefile.macosx

Invoke with:

./agent

Prerequisites - Windows

The Windows build requires Visual C++ 2010 or later to be installed, as well as the MozillaBuild environment. Install both, then launch a MozillaBuild shell by running start-shell-msvcXXXX.bat, where XXXX is the version you have installed (i.e. 2010).

You will first need to build a copy of NSPR. Download the latest NSPR source from the Mozilla download server, currently NSPR 4.10.6 and untar it, or clone it from the NSPR Mercurial repository using hg. In the NSPR source directory execute:

./configure --enable-win32-target=WIN95 && make

Once NSPR is built, build Negatus with:

make -f Makefile.win NSPR=/path/to/nspr_directory

where /path/to/nspr_directory is the directory you unpacked the NSPR source to in the previous step.

You can start Negatus by typing:

PATH=$PATH:/path/to/nspr_directory/bin ./agent

You can alternately copy nspr4.dll and plc4.dll to the same directory as agent.exe to avoid setting PATH each time.