Using the startup script init.rc in Android, you can perform simple operations in the initialization of the system.Init.rc Startup script path: system/core/rootdir/init.rcContent:
Commands: Command
Actions: Actions
Triggers: Trigger Condition
Services: Service
Options: Option
Properties: Attributes
Commands are some basic operati
following:# This file was used to override default values used by the Ant build system.## This file must being checked in Version contro L Systems, as it is# integral to the build system of your project.# this file is only used by the Ant script.# you can use This to override default values such as# ' Source.dir ' for the location of the your Java source folder and# ' Out.dir ' For the location of your output folder.# your can also use it define h
Lua learning Note 3 Android calls Lua. The Lua script calls back Java using loadlib and transmits multiple parameters.
Multiple parameters can be received in Java and each parameter is displayed.
The method for loading the Lua script in Android is not the focus of this article. You can refer to the notes in front of t
The Android device has been used for a long time, and screenshots are a hassle. The more troublesome is through QQ to the computer, for half a day. In fact, with the ADB command can screen, and then write a pull statement can be pulled to the computer. The file name is capture.sh and reads as follows:
#! /bin/bash
adb shell screencap-p/sdcard/test.png
#adb pull/sdcard/test.png ~/desktop/test.png
dir=~/ desktop/
curr= ' date ' +%y-%m-%d%h:%m:%
Emulatorpid= ' Ps-ef | grep "Emulator" | grep "Port $portNumber" | awk ' {print $} ' `
If [-N "$emulatorPID"]; Then
echo "Close Emulator Window"
Kill-9 $emulatorPID
Fi
# Create the simulator, the Force option can overwrite the existing emulator, that is, sdcard content is erased. Echo No is the answer does not require a custom hardware configurationecho "Create AVD"Emulatorname= "Test"Echo No | Android Create AVD--name $emulatorName--force--
of the script after the interval of time to see if the memory has been growing, if the growth is not stable, there is a memory leakExample:From Com.android.monkeyrunner import Monkeyrunner,monkeydevice,monkeyimageDevice=monkeyrunner.waitforconnection ()Print 3Monkeyrunner.sleep (1)Print 2Monkeyrunner.sleep (1)Print 1Monkeyrunner.sleep (1)print ' Start ... 'Monkeyrunner.sleep (1)For I in Range (10000000):I=i+1Print IDevice.drag ((355,1240), (355,542),
When releasing paid Android apps, You need to randomly generate SALT scrambling codes in the file. The following is a Python script (of course you can choose C/Java/SHELL/Perl or anything else)
#! /Usr/bin/python # Filename: gen_salt.py import random salt = [] for I in range (0, 30): salt. append (random. randint (-128,127) print salt
Run $ python gen_salt.py and the result is as follows: [4, 30, 42,-124,
Android OTA update package creation script (2. Decompress), androidota
Step 1: extract (ota_from_target_files)
print "unzipping target target-files..." OPTIONS.input_tmp, input_zip = common.UnzipTemp(args[0])The above code is the portal to start decompression.
Def UnzipTemp (filename, pattern = None): "Unzip the given archive into a temporary directory and return the name. if filename is of the form "f
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.