AWZ · API reference
AWZ is controlled through HTTP commands of the form /cmd?fun=command¶meters.
| Item | Value |
|---|---|
| On-device scripts | http://127.0.0.1:1688/cmd? |
| From a computer | http://device-LAN-IP:1688/cmd? |
| Method | GET |
| Result file | /var/mobile/iggresult.txt |
| Parameter file | /var/mobile/iggparams.txt |
| Record name list | /var/mobile/iggrecords.txt |
Before you call anything
- Turn on Enable HTTP script commands in AWZ Settings → Scripts.
- AWZ must be in the foreground before every command:
runApp("AWZ")
mSleep(3 * 1000) -- First launch verifies the license online; waiting 3 seconds is safeReturn values
The call returns JSON directly:
{"result": 1}The same value is written to /var/mobile/iggresult.txt, and both always agree:
| Value | Meaning |
|---|---|
1 | Completed |
2 | Running, not finished yet |
3 | Reset succeeded but the IP address is a duplicate (newrecord only) |
4 | Reached the last record (nextrecord only) |
0 | Execution error |
10 | Runtime environment error |
100 | Product not activated, or the license expired |
Endpoint list
| Function | Command |
|---|---|
| Reset | newrecord |
| Next record | nextrecord |
| Activate a specific record | activerecord |
| Activate the first / last record | activefirstrecord · activelastrecord |
| Disable / re-enable a record | disablerecord · enablerecord |
| Delete a specific record | deleterecord |
| Clear every record | deleteallrecords |
| Slim a specific record | thinrecord |
| Export a specific record | exportrecord |
| Export every record | exportallrecords |
| Import a record directly | importdirect |
| Import a record in compatibility mode | importcompatible |
| Import an NZT record | importnzt |
| Rename the current record | renamecurrentrecord |
| Set / clear the current record's coordinates | setcurrentrecordlocation · clearcurrentrecordlocation |
| Get / set the current record's parameters | getcurrentrecordparam · setcurrentrecordparam |
| Get every record name | getallrecordnames |
| Clean App Store data | cleanappstore |
| Uninstall the selected apps | uninstallselectedapp |
| Sort by time | orderbytime · orderbytimedesc |
Endpoint details
All addresses below use the on-device 127.0.0.1. From a computer, substitute the device's LAN IP.
Reset
GET http://127.0.0.1:1688/cmd?fun=newrecordGenerates a new device and creates a record. A return value of 3 means the reset worked but the IP duplicates an existing record — your script can decide whether to rotate the IP and retry.
Next record
GET http://127.0.0.1:1688/cmd?fun=nextrecordSwitches to the next record. A return value of 4 means you are already on the last one.
Activate a specific record
GET http://127.0.0.1:1688/cmd?fun=activerecord&record=record-id| Parameter | Required | Notes |
|---|---|---|
record | Yes | Record ID |
Activate the first / last record
GET http://127.0.0.1:1688/cmd?fun=activefirstrecord
GET http://127.0.0.1:1688/cmd?fun=activelastrecordDisable / re-enable a record
GET http://127.0.0.1:1688/cmd?fun=disablerecord&record=record-id
GET http://127.0.0.1:1688/cmd?fun=enablerecord&record=record-id| Parameter | Required | Notes |
|---|---|---|
record | Yes | Record ID |
Delete a specific record
GET http://127.0.0.1:1688/cmd?fun=deleterecord&record=record-idClear every record
GET http://127.0.0.1:1688/cmd?fun=deleteallrecordsWipes every record. This cannot be undone.
Slim a specific record
GET http://127.0.0.1:1688/cmd?fun=thinrecord&record=record-idTrims the given record to reduce the disk space it uses.
Export a specific record
GET http://127.0.0.1:1688/cmd?fun=exportrecord&record=record-idExports to /var/mobile/exportdata/.
Export every record
GET http://127.0.0.1:1688/cmd?fun=exportallrecords&zip=file-name| Parameter | Required | Notes |
|---|---|---|
zip | Yes | File name of the exported archive |
Exports to /var/mobile/exportdata/.
Import a record directly
GET http://127.0.0.1:1688/cmd?fun=importdirectPut the record to import in /var/mobile/importdata/ — either an exported folder or an exported zip.
Import a record in compatibility mode
GET http://127.0.0.1:1688/cmd?fun=importcompatibleImports from /var/mobile/importdata/ in compatibility mode, accepting either a folder or a zip. Try this when a direct import fails.
Import an NZT record
GET http://127.0.0.1:1688/cmd?fun=importnztPut the NZT record in /var/mobile/nztdata/. It must be an unpacked folder or an unencrypted zip.
Rename the current record
GET http://127.0.0.1:1688/cmd?fun=renamecurrentrecord&name=new-name| Parameter | Required | Notes |
|---|---|---|
name | Yes | New name. URL-encode it if it contains non-ASCII characters |
Tip
After renaming, the new name becomes the record ID. Later commands such as activerecord must use the new name.
Set / clear the current record's coordinates
GET http://127.0.0.1:1688/cmd?fun=setcurrentrecordlocation&location=longitude_latitude_place
GET http://127.0.0.1:1688/cmd?fun=clearcurrentrecordlocation| Parameter | Required | Notes |
|---|---|---|
location | Yes | Format longitude_latitude_place-name. The place name is optional, for example 116.7361382365_39.8887921413_Beijing |
Get / set the current record's parameters
GET http://127.0.0.1:1688/cmd?fun=getcurrentrecordparam
GET http://127.0.0.1:1688/cmd?fun=setcurrentrecordparamgetcurrentrecordparam: writes the current record's parameters to/var/mobile/iggparams.txtsetcurrentrecordparam: reads/var/mobile/iggparams.txtand applies those parameters to the current record
Correct flow: get first, edit the fields in the file, then set. See Parameter file for the format.
Get every record name
GET http://127.0.0.1:1688/cmd?fun=getallrecordnamesThe list of names is written to /var/mobile/iggrecords.txt.
Clean App Store data
GET http://127.0.0.1:1688/cmd?fun=cleanappstoreIf "Clean App Store" is already enabled in the app settings, a reset runs it automatically and you do not need to call this.
Uninstall the selected apps
GET http://127.0.0.1:1688/cmd?fun=uninstallselectedappIf "Uninstall apps" is already enabled in the app settings, a reset runs it automatically and you do not need to call this.
Sort by time
GET http://127.0.0.1:1688/cmd?fun=orderbytime
GET http://127.0.0.1:1688/cmd?fun=orderbytimedescorderbytime sorts the record list oldest first; orderbytimedesc sorts it newest first.
Parameter file
Path: /var/mobile/iggparams.txt
- One parameter per line, separated by
chr(10) - The name and value are separated by a colon
: - Call
getcurrentrecordparamand open the file to see the exact format
| Parameter | Notes |
|---|---|
RecordID | Record ID, e.g. wechat001 |
DeviceName | Device name, e.g. xxxx iPhone |
SystemVersion | iOS version number, e.g. 10.3.1 |
IDFA | IDFA |
IDFV | IDFV |
62short | 32-digit short 62 code |
62long | 344-digit full 62 code. When setting parameters, supplying either 62short or 62long is enough |
UDID | Device UDID |
IMEI | Device IMEI |
SerialNum | Device serial number |
MAC | MAC address |
SSID | Wi-Fi network name |
BSSID | Wi-Fi BSSID |
OpenUDID | OpenUDID |
Lua example (TouchSprite)
local sz = require("sz")
local http = require("szocket.http")
local BASE = "http://127.0.0.1:1688/cmd?fun="
-- URL encoding (needed for non-ASCII names and place names)
function urlEncode(s)
s = string.gsub(s, "([^%w%.%- ])", function(c)
return string.format("%%%02X", string.byte(c))
end)
return string.gsub(s, " ", "+")
end
-- Call a command and return its result; a value of 2 means running, so it waits
function AWZ(query)
local res, code = http.request(BASE .. query)
if code ~= 200 then return nil end
local result = sz.json.decode(res).result
while result == 2 do
mSleep(1000)
result = tonumber(readFileString("/var/mobile/iggresult.txt"))
end
return result
end
-- 1. Launch AWZ (required before any command)
runApp("AWZ")
mSleep(3 * 1000)
-- 2. Reset, retrying when the IP is a duplicate
local r = AWZ("newrecord")
if r == 3 then
toast("IP is a duplicate, rotate your IP and retry", 2)
elseif r == 100 then
toast("Not activated, or the license expired", 2)
elseif r ~= 1 then
toast("Reset failed: " .. tostring(r), 2)
end
-- 3. Rename the current record (new-name becomes the record ID)
AWZ("renamecurrentrecord&name=" .. urlEncode("139xxxxxxx John"))
-- 4. Set the coordinates
AWZ("setcurrentrecordlocation&location=" .. urlEncode("116.7361382365_39.8887921413_Beijing"))
-- 5. Activate a specific record
AWZ("activerecord&record=" .. urlEncode("Wechat001"))
-- 6. Walk every record
AWZ("activefirstrecord")
while true do
-- ... your own logic here ...
if AWZ("nextrecord") == 4 then break end
endFor usage, see the AWZ user guide.
The interface and supported systems may change with updates. Back up important data before cleaning, resetting or deleting anything.
