After compiling and packaging the APK, install the APK on the phone, connect the data cable, open the command line, and enter the following command:
[Java]View Plaincopy
- ADB logcat-v time-s nbsagent:v
Then run an app embedded in the listen cloud code for effective network access and, if the following occurs,
[Java]View Plaincopy
- Nbsagent start
- Nbsagent enabled
- Nbsagent V1. 1.x
- Connect success
The embedding succeeds or fails
When embedding the listening cloud Code, the fifth step is as follows:
[Plain]View Plaincopy
- (5) Set environment variable ant_opts
- In Mac OS and Linux Environment:
- Export ant_opts= "-javaagent:/path/to/nbs-android-agent/nbs.newlens.class.rewriter.jar"
- In Windows Environment:
- SET ant_opts= "-javaagent:c:\path\to\nbs-android-agent\nbs.newlens.class.rewriter.jar"
- Please replace the "/path/to/nbs-android-agent/" with your actual SDK store path.
- Notice:please don ' t set the environment variable (i.e. ant_opts) in user or system environment variable permanently, othe Rwise it would make effects to other Android projects with no need embedded-code.
- Strongly propose to set the environment variable temporarily in single compiling command-line, or set the environment Vari Able separately in batching compile script of the project, that need embedded-code.
- Notice:because of the affect caused by some known bugs in Android development tools, please don ' t use blank in the path of Nbs.newlens.class.rewriter.jar file.
Note the point:
It is necessary to copy Nbs.newlens.class.rewriter.jar to the SDK directory of your computer, such as/home/yee/tools/sdk
[Plain]View Plaincopy
- And the/path/to/nbs-android-agent need to be set to <span style= "Color:rgb (0, 128, 0); line-height:24px; RGB (243, 243, 243); " >/home/yee/tools/sdk</span>
[Plain]View Plaincopy
- <span style= "Color:rgb (0, 128, 0); line-height:24px; RGB (243, 243, 243); " > also said, if the SDK absolute path is <span style= "Color:rgb (0, 128, 0); line-height:24px; RGB (243, 243, 243); " >/home/yee/tools/sdk</span></span>
[Plain]View Plaincopy
- <span style= "Color:rgb (0, 128, 0); line-height:24px; RGB (243, 243, 243); " ><span style= "Color:rgb (0, 128, 0); line-height:24px; RGB (243, 243, 243); " > </span></span><pre name= "code" class= "plain" >set ant_opts= "-javaagent:c:\path\to\ Nbs-android-agent\nbs.newlens.class.rewriter.jar "
[Plain]View Plaincopy
- <pre name= "code" class= "plain" ><pre name= "code" class= "plain" style= "Color:rgb (0, 128, 0); line-height:24px; " > This sentence should be changed to
Export ant_opts= "-javaagent:/home/yee/tools/sdk/nbs.newlens.class.rewriter.jar"
[Plain]View Plaincopy
- I must remember.
Android to determine if the cloud is embedded correctly